How can I set a default value for a Select field in a Filament form when editing a record?
```
Why is the default value not being set for a multi-select (Select::make()->multiple()) field in Filament, and how can I fix it?
SelectColumn::make('status')
->options([
'draft' => 'Draft',
'reviewing' => 'Reviewing',
'published' => 'Published',
])->default('draft')
2 Replies
In the editing context it should already have a value. That should have been handled on creation of the record. But you can use ->afterStateHydrated() to set a default. Or the formFill() on the LW component.
Use
mutateDataBeforeFill()
for EditPages