protected function newMatchAllQuery($tags = [])
{
$tags = (array) $tags;
$grammar = $this->media()->getConnection()->getQueryGrammar();
return $this->media()->newPivotStatement()->where($this->media()->getMorphType(), $this->media()->getMorphClass())->whereIn('tag', $tags)->groupBy($this->media()->getOtherKey())->havingRaw('count(' . $grammar->wrap($this->media()->getOtherKey()) . ') = ' . count($tags));
}