How to modify ToggleColumn function?

It's amazing how ToggleColumn can update to the backend, but I'm curious about how to customize that.

I have a column is_primary. Once I toggled a row, the other rows is_primary must be toggled too. So if I set the is_primary to
true
, the other rows is_primary will be
false
.

ToggleColumn::make('is_primary')
Solution
You can overwrite the behaviour via updateStateUsing()
Was this page helpful?