Select menu. Enum. How set default-selected
I got a field in DB and model, which is an enum type. Something like this:
['xxx', 'yyy', 'zzz']
In filament, I did:
In the DB, the field stage
is already set to yyy
. But the menu still displays xxx
4 Replies
Because your xxx, yyy, zzzz will be: 1,2,3
Setup a proper enum class and do it properly
https://filamentphp.com/docs/3.x/support/enums
So it should be an assoc array?
['xxx'=>'xxx', 'yyy'=>'yyy', 'zzz'=>'zzz']
yes
but if you just do the enum class properly it'll be easy for your filters etc too
Yep. Turned out to be as easy as
Thank you