Conditionally hide a section

Hi. Is it possible to conditionally hide a Section, based on another value on the form? E.g.:
//...

Forms\Components\Section::make('Options')
->schema([
Forms\Components\Toggle::make('receiveable')
->required(),
])
// Conditional Section for 'receivable'
Forms\Components\Section::make('Receivable Details')
->schema([
// Fields goes here...
])->hidden(fn ($get): bool => $get('receiveable') == false)
//...

Forms\Components\Section::make('Options')
->schema([
Forms\Components\Toggle::make('receiveable')
->required(),
])
// Conditional Section for 'receivable'
Forms\Components\Section::make('Receivable Details')
->schema([
// Fields goes here...
])->hidden(fn ($get): bool => $get('receiveable') == false)
The section Receivable Details is hidden on page load, but I want to show/hide it based on the toggle value from receivable
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server