You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That example you are quoting is not a filter, but an example for an existing query.
I think there is no chained method for that, spatie's laravel-query-builder specifies that any extra filter has to be made into a scope or custom filter:
See Scope Filters section
See Custom Filters section
I have not tested, but this would have to work if your $query is a User model class element.
This is the scoped approach:
In your User model
Referenced Builder is this one: use Illuminate\Database\Eloquent\Builder;
public function scopeScoreGreaterThan(Builder $query, $value): Builder
{
return $query->where('score', '>', $value);
}
How filter (gt) great than or (lt) less than?
Like spatie/laravel-query-builder example.
Reading the code, this is not possible right now.
Updated:
Sure, we can create scoped filters, but, a lot of work for a Great/Less than only.
The text was updated successfully, but these errors were encountered: