F
Filamentβ€’2y 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β€’2y ago
You really should read the docs πŸ˜‰ ->default(['draft', 'reviewing', 'published'])
ericmp #2
ericmp #2OPβ€’2y ago
thanks & sorry πŸ™

Did you find this page helpful?