src/Mediable.php
protected function newMatchAllQuery($tags = [])
    {
        $tags = (array) $tags;
        $grammar = $this->media()->getBaseQuery()->getGrammar();
        return $this->media()->newPivotStatement()
            ->where($this->media()->getMorphType(), $this->media()->getMorphClass())
            ->whereIn('tag', $tags)
            ->groupBy($this->mediaQualifiedRelatedKey())
            ->havingRaw('count('.$grammar->wrap($this->mediaQualifiedRelatedKey()).') = '.count($tags));
    }
protected function newMatchAllQuery($tags = [])
    {
        $tags = (array) $tags;
        $grammar = $this->media()->getBaseQuery()->getGrammar();
        return $this->media()->newPivotStatement()
            ->where($this->media()->getMorphType(), $this->media()->getMorphClass())
            ->whereIn('tag', $tags)
            ->groupBy($this->mediaQualifiedRelatedKey())
            ->havingRaw('count('.$grammar->wrap($this->mediaQualifiedRelatedKey()).') = '.count($tags));
    }
protected function newMatchAllQuery ( $ tags = [ ] ) { $ tags = ( array ) $ tags ; $ grammar = $ this -> media ( ) -> getBaseQuery ( ) -> getGrammar ( ) ; return $ this -> media ( ) -> newPivotStatement ( ) -> where ( $ this -> media ( ) -> getMorphType ( ) , $ this -> media ( ) -> getMorphClass ( ) ) -> whereIn ( 'tag' , $ tags ) -> groupBy ( $ this -> mediaQualifiedRelatedKey ( ) ) -> havingRaw ( 'count(' . $ grammar -> wrap ( $ this -> mediaQualifiedRelatedKey ( ) ) . ') = ' . count ( $ tags ) ) ; }
Generate a query builder for.
@param  string|string[] $tags
@return \Illuminate\Database\Query\Builder
Generate a query builder for .