F
Filamentβ€’3mo ago
roy21

select filter lazy loading

How to add lazy loading to the select filter on table? Something like this if available
SelectFilter::make('status')
->paginate(10)
SelectFilter::make('status')
->paginate(10)
Thank you
3 Replies
toeknee
toekneeβ€’3mo ago
Why would you want to paginate the status column which should only have a handful?
403gtfo
403gtfoβ€’3mo ago
How I'd do it if you have a zillion statues (which you wouldnt).
SelectFilter::make('status')
->searchable()
->optionsLimit(20),
SelectFilter::make('status')
->searchable()
->optionsLimit(20),
Or if, more realistically, you are pulling Status options from another model:
SelectFilter::make('status')
->relationship('statuses', 'name')
->searchable()
->preload(),
SelectFilter::make('status')
->relationship('statuses', 'name')
->searchable()
->preload(),
Filament is pretty good and performance stuff unless you throw it a raw 1000 options in ->options([]). searchable() is amazing πŸ™‚ Hope this helps?
roy21
roy21OPβ€’3mo ago
Sorry I gave the wrong example, it should be filter by people names/id and it will be plenty Thanks, I'll try it
Want results from more Discord servers?
Add your server