F
Filamentβ€’10mo ago
ericmp #2

Automatically select some options

I'm building a create form. By default, i want an option of the Select have to be selected, but idk how to achieve it. example from docs:
use Filament\Forms\Components\Select;

Select::make('status')
->options([
'draft' => 'Draft',
'reviewing' => 'Reviewing',
'published' => 'Published',
])
use Filament\Forms\Components\Select;

Select::make('status')
->options([
'draft' => 'Draft',
'reviewing' => 'Reviewing',
'published' => 'Published',
])
so let say i want the draft to be selected by default. how to?
2 Replies
toeknee
toekneeβ€’10mo ago
You really should read the docs πŸ˜‰ ->default(['draft', 'reviewing', 'published'])
ericmp #2
ericmp #2β€’10mo ago
thanks & sorry πŸ™