Closed Brotzka closed 6 years ago
Yes it is, but you cannot use the where
directive like that, it's a caveat. As mentioned in the docs (https://github.com/rinvex/attributes#querying-models), you should use the whereHas
method. Every attribute acts as a relationship, so they can be queried that way:
$companies = Company::whereHas('Cities', function (\Illuminate\Database\Eloquent\Builder $builder) {
$builder->where('content', 'Alexandria');
})->get();
Hi!
Is it possible to user multiple where clauses on entities using attributes? Like so:
Thanks in advance!