Toggle implementation Using Sqlite
I am using sqlite which doesnt have a Boolean datatype. Can I still use the toggle feature? I tried just creating a text column and adding code on filament treating toggle as a boolean, but it isnt saving to the DB.
6 Replies
Try removing the boolean approach in the cast since the DB doesn't support it, it depends how strict the datatype is when we render it as natively in php 1, 0 are true and false too.
If it updates but doesn't render the change use:
The cast is all you should need. Is
is_admin
fillable?Does cast not case to the DB too and if it's boolean it would fail filling?
It's also stored as 0/1 in MySQL
Thats what was missing...adding it there got it to work. Thanks @Dennis Koch & @toeknee_iom
If you are using filament for all your model inputs, then just disable model fillables as per the filament docs.