No way to add sideeffects to ToggleColumn?
I am making an admin panel to interact with another API. When the user toggles a ToggleColumn switch, I want to conditionally allow the state change depending on the API.
Unfortunately I can't get any kind of conditional state change on ToggleColumn. I have tried updating the event after state is updated.
I have tried updateStateUsing, which doesn't seem to update the state as far as I can tell.
Solution:Jump to solution
Sounds like an issue with your model then. Not Filament. Is the field fillable?
6 Replies
Bump
I have tried updateStateUsing, which doesn't seem to update the state as far as I can tell.So your event is not
$live = true
aftetr this? Is the callback called?It's definitely called, but it's not $live = true after.
Solution
Sounds like an issue with your model then. Not Filament. Is the field fillable?
No! Thank you, thought that would error out.
I think
Model::preventSilentlyDiscardingAttributes()
in a ServiceProvider should do that