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
.
5 Replies
Solution
You can overwrite the behaviour via
updateStateUsing()
Cool that worked! I hope someone can update the docs too https://filamentphp.com/docs/2.x/tables/columns/toggle hehe.
but v3 is coming soon, this is gonna be exciting hehe.
Filament
Toggle column - Columns - Table Builder - Filament
The elegant TALL stack table builder for Laravel artisans.
@vahnmarty what did you end up putting in the updateStateUsing? I have the exact same use case and was hoping you would share π
Danke!