Hiding based on another field's state not working on edit form

Hi all I've got a form with a "type" select field and several sections that are hidden based on the type:
Section::make('Type 1')
->hidden(fn (Get $get) => $get('type') !== TypeEnum::TYPE_1->value)
Section::make('Type 1')
->hidden(fn (Get $get) => $get('type') !== TypeEnum::TYPE_1->value)
This works for the create form, but the section isn't visible on the edit form even though the select field is already set to a type. I have to manually play around with the select field to get the section to show. Is there a trick to make $get work with initial form state? There's probably something obvious I'm missing...
Solution:
Never mind, it was a casting issue.
Jump to solution
1 Reply
Solution
binaryfire
binaryfire15mo ago
Never mind, it was a casting issue.
Want results from more Discord servers?
Add your server