F
Filamentβ€’15mo 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β€’15mo ago
You really should read the docs πŸ˜‰ ->default(['draft', 'reviewing', 'published'])
ericmp #2
ericmp #2OPβ€’15mo ago
thanks & sorry πŸ™
Want results from more Discord servers?
Add your server