Cviebrock\EloquentTaggable\Taggable::scopeWithAllTags PHP Метод

scopeWithAllTags() публичный Метод

Scope for a Model that has all of the given tags.
public scopeWithAllTags ( Builder $query, array | string $tags ) : Builder
$query Illuminate\Database\Eloquent\Builder
$tags array | string
Результат Illuminate\Database\Eloquent\Builder
    public function scopeWithAllTags(Builder $query, $tags)
    {
        $normalized = app(TagService::class)->buildTagArrayNormalized($tags);
        return $query->has('tags', '=', count($normalized), 'and', function (Builder $q) use($normalized) {
            $q->whereIn('normalized', $normalized);
        });
    }