© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
3 replies
daerentis

SelectFilter with options from custom query

I am trying to show a SelectFilter for possible values of a specific column. I tried using the options() method and passing an Eloquent query in a local copy of the Filament demo application, like so:
SelectFilter::make('name')->options(Product::all()->pluck('name', 'name'))
SelectFilter::make('name')->options(Product::all()->pluck('name', 'name'))
`
Got the idea of this approach from https://filamentphp.com/tricks/filter-by-multiple-spatie-tags.

It is working a expected but in Debugbar i see a bunch of database requests. Normally executing one should be enough to fill the SelectFilter.
Looks like every Trait (HasActions, HasBulkActions,...) is triggering it. Am I missing something? Doing So many requests is not really a solution at the moment.
Bildschirmfoto_2023-06-21_um_15.46.58.png
Bildschirmfoto_2023-06-21_um_15.53.11.png
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

SelectFilter with relationship query
FilamentFFilament / ❓┊help
2y ago
how to change selectfilter options based on another selectfilter?
FilamentFFilament / ❓┊help
3mo ago