© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•16mo ago•
3 replies
NolanN

Default option for select filter

I'm trying to set the default option in a select filter but it doesn't seem to apply.

SelectFilter::make('lead_type_profile_id')
    ->label('Lead Types')
    ->options(Filament::getTenant()->tenant->leadTypeProfiles->pluck('name', 'id'))
    ->default(Filament::getTenant()->tenant->leadTypeProfiles()->base()->first()->id)
    ->query(fn (Builder $query) => $query)
    ->multiple()
    ->preload(),
SelectFilter::make('lead_type_profile_id')
    ->label('Lead Types')
    ->options(Filament::getTenant()->tenant->leadTypeProfiles->pluck('name', 'id'))
    ->default(Filament::getTenant()->tenant->leadTypeProfiles()->base()->first()->id)
    ->query(fn (Builder $query) => $query)
    ->multiple()
    ->preload(),


Using only
default()
default()
also fails to set a default selection. And I don't want to use
selectablePlaceholder(false)
selectablePlaceholder(false)
because I do have a case where all options need to be shown in the table.
Solution
I realized this is because I'm using
multiple()
multiple()
so I need to return an array in
default()
default()
. Here was what fixed it for me:
->default([Filament::getTenant()->tenant->leadTypeProfiles()->base()->first()->id])
->default([Filament::getTenant()->tenant->leadTypeProfiles()->base()->first()->id])
Jump to solution
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

Disable Select Filter Default "All" Option
FilamentFFilament / ❓┊help
2y ago
Select filter - remove/disable default option
FilamentFFilament / ❓┊help
3y ago
How to set Select Filter Default
FilamentFFilament / ❓┊help
2y ago
Question about filter datepicker display and filter select option
FilamentFFilament / ❓┊help
3y ago