public function scopeWhereHasMediaMatchAll(Builder $q, array $tags)
    {
        $grammar = $q->getQuery()->getGrammar();
        $subquery = $this->newMatchAllQuery($tags)
            ->selectRaw('count(*)')
            ->whereRaw($grammar->wrap($this->mediaQualifiedForeignKey()).' = '.$grammar->wrap($this->getQualifiedKeyName()));
        $q->whereRaw('('.$subquery->toSql().') >= 1', $subquery->getBindings());
    }