How can I make it work?
I have tried to generate the condition in the second repeater but the condition does not work, what I want is that if the variable inputs->type == 'Select' the repeater is shown, if not hidden
Solution:Jump to solution
1.
Select::make('type')->reactive()
2. Repeater::make('options')->hidden(fn(callable $get) => $get('type') == 'select')
...9 Replies
Please upgrade to the latest Filament version using
composer update
.Use
->hidden(
instead of ->when(
Check the docs for dependable selects
Solution
1.
Select::make('type')->reactive()
2. Repeater::make('options')->hidden(fn(callable $get) => $get('type') == 'select')
It’s in the advanced form section
this way worked for me, thank you very much
For explanation: Record is always the stored model and not the data in the form. That’s why
$record
doesn’t work
Also please use more descriptive titles in the future.I'll keep it in mind, thanks
You are welcome. but anyway, take a look at the docs, there are a lot of interesting things - https://filamentphp.com/docs/2.x/