Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

demonz's avatar

I can't find this method in Inertia js demo

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,
                ]),
        ]);
    }
0 likes
2 replies

Please or to participate in this conversation.