Level 104
It is a local scope on the Organization model; which you can find here
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello I am trying to make search function similar to inertia js demo app PingCRM but the problem is that I get an error Call to undefined method Illuminate\Database\Eloquent\Builder::filter() and I don't know where I can find this filter() method and how I implement it
thanks
public function index()
{
return Inertia::render('Organizations/Index', [
'filters' => Request::all('search', 'trashed'),
'organizations' => Auth::user()->account->organizations()
->orderBy('name')
->filter(Request::only('search', 'trashed'))
->paginate(10)
->withQueryString()
->through(fn ($organization) => [
'id' => $organization->id,
'name' => $organization->name,
'phone' => $organization->phone,
'city' => $organization->city,
'deleted_at' => $organization->deleted_at,
]),
]);
}
It is a local scope on the Organization model; which you can find here
Please or to participate in this conversation.