Default option for select filter
I'm trying to set the default option in a select filter but it doesn't seem to apply.
Using only
default()
also fails to set a default selection. And I don't want to use selectablePlaceholder(false)
because I do have a case where all options need to be shown in the table.Solution:Jump to solution
I realized this is because I'm using
multiple()
so I need to return an array in default()
. Here was what fixed it for me: ->default([Filament::getTenant()->tenant->leadTypeProfiles()->base()->first()->id])
1 Reply
Solution
I realized this is because I'm using
multiple()
so I need to return an array in default()
. Here was what fixed it for me: ->default([Filament::getTenant()->tenant->leadTypeProfiles()->base()->first()->id])