F
Filament3w ago
YN20

Filament Checkbox Column toggle prevent query update

Hello friends i have checkbox column and i want to prevent the checkbox from firing when a condition is met. i tried to return false but didnt work is there any way to achieve this. thanks
CheckboxColumn::make('toggle')->label('show home')
->beforeStateUpdated(function ($record, $state) {
// check with db based on a condition and terminate operation
}),
CheckboxColumn::make('toggle')->label('show home')
->beforeStateUpdated(function ($record, $state) {
// check with db based on a condition and terminate operation
}),
2 Replies
Dimitar
Dimitar3w ago
I think there is a ->disableClick() method that accepts params, did you tried it? CheckboxColumn::make('toggle')->disableClick(fn($record) => $record->invisible )
No description
YN20
YN20OP3w ago
No I didn't I looked but I couldn't find in the docs so I switched to a select

Did you find this page helpful?