Property null after submit

Hi I use the radio input and my select is hidden if all option is chosen but if I chose multi-select option $farmId is always null but if I remove the function hidden it is okay
Section::make('Select Farm')
->schema([
Radio::make('type')
->reactive()
->options([
'all' => 'All',
'multi-select' => 'Multi Selection',
]),
Select::make('farmId')
->multiple()
->reactive()
->hidden(fn(\Closure $get) => $get('type') == 'all')
->label('Ferme')
->options(Ferme::all()->pluck('name', 'id'))
->searchable(),
]),
Section::make('Select Farm')
->schema([
Radio::make('type')
->reactive()
->options([
'all' => 'All',
'multi-select' => 'Multi Selection',
]),
Select::make('farmId')
->multiple()
->reactive()
->hidden(fn(\Closure $get) => $get('type') == 'all')
->label('Ferme')
->options(Ferme::all()->pluck('name', 'id'))
->searchable(),
]),
2 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
tidiani12
tidiani12OP2y ago
I have $guarded = [] the radio input is not bind with any model it is only for showing select input or not
Want results from more Discord servers?
Add your server