FilamentF
Filament6d ago
4 replies
MARLBORINO CAOS

Form select default value doesn’t work

In my form I’m unable to set the default value correctly. The select field always displays the first option, ignoring the default value I set. I’ve tried multiple approaches, but none of them worked. What is the correct way to set a default value for a select field in this case? Thanks.

->schema([
    Select::make('arrotondamentoS')
        ->label('Policy')
        ->options([
            '0' => 'Nessun arrotondamento',
            '1' => 'Step 0,10 EUR',
            '2' => 'Step 0,50 EUR',
            '3' => 'fine-price a .99',
        ])
        ->default('2')
        ->selectablePlaceholder(false)
        ->required(),
])
Was this page helpful?