Ability to hide a repeater item

Hello! Is it possible to hide repeater items if a specific column is null?
TableRepeater::make('blockedDates')
->relationship()
->schema([
Forms\Components\DateTimePicker::make('start_date')
->label('van')
->disableLabel()
->default(now()->setTime(14, 0, 0))
->displayFormat('d-m-Y, H:i'),

Forms\Components\DateTimePicker::make('end_date')
->label('tot')
->disableLabel()
->default(now()->addDays(2)->setTime(11, 0, 0))
->displayFormat('d-m-Y, H:i'),
])
->label('Handmatig geblokkeerde data')
->createItemButtonLabel('Data toevoegen')
->collapsible()
->cloneable()
->minItems(0)
->columnSpan('full'),
TableRepeater::make('blockedDates')
->relationship()
->schema([
Forms\Components\DateTimePicker::make('start_date')
->label('van')
->disableLabel()
->default(now()->setTime(14, 0, 0))
->displayFormat('d-m-Y, H:i'),

Forms\Components\DateTimePicker::make('end_date')
->label('tot')
->disableLabel()
->default(now()->addDays(2)->setTime(11, 0, 0))
->displayFormat('d-m-Y, H:i'),
])
->label('Handmatig geblokkeerde data')
->createItemButtonLabel('Data toevoegen')
->collapsible()
->cloneable()
->minItems(0)
->columnSpan('full'),
i would like to hide the repeater row if
calendar_id === null
calendar_id === null
on blockedDates. Thanks in advance!
1 Reply
toeknee
toeknee2y ago
->hidden(fn(Closure $get) => is_null($get('calendar_id'))
->hidden(fn(Closure $get) => is_null($get('calendar_id'))
maybe use
->hidden(fn(Closure $get) => is_null($get('../calendar_id'))
->hidden(fn(Closure $get) => is_null($get('../calendar_id'))
If it's statePath is higher due to the relationship
Want results from more Discord servers?
Add your server