F
Filament2mo ago
Neamix

Select default value from select dropdown

I want to set to set default value that i need it to be selected when the form render i tried this
Select::make('status')
->options([
'draft' => 'Draft',
'reviewing' => 'Reviewing',
'published' => 'Published',
])
->default('draft'),
Select::make('status')
->options([
'draft' => 'Draft',
'reviewing' => 'Reviewing',
'published' => 'Published',
])
->default('draft'),
but not working
3 Replies
Dennis Koch
Dennis Koch2mo ago
Let me guess: You are editing not creating?
Neamix
NeamixOP2mo ago
yes , i have a custom page called members and it have edit action in that edit action i have the select
awcodes
awcodes2mo ago
Default only works when creating records. When in the edit context/operation it should have already been set as part of the record data. Ie, if a field has a default it should already be set to that default when the record is created.
Want results from more Discord servers?
Add your server