Form trying to update a field that is not in the form
This is my form (simplified)
When I try to save it, the query also includes a field that is not in the form
As you can see, there is an extra
alert
field there.
Just to be clear, the tables does have an alert column, but why is the form trying to update it if it's not in the schema?12 Replies
share the whole code
There's not much to share TBH. Here is the schema
But I think the issue might be related to the alert field. It's included through a trait like this
I still don't understand why it would try to save it if it's not in the form or if there's a workaround for it
where is the alert?
What do you mean?
where are you using this alert?
I'm ... still not sure what you mean? :/ I don't use it anywhere in the form - it's a field that exists on the model
I just created a trait for it because I also use the same login logic in other models
hum..
CreatePage.php
what is the output?
Hmm this is an edit form
beforeSave
Yeap I'll try both sec
I tried these
but nothing happens. Is it because the form is in the resource?
did you add this to the EditPage?
Yeap
actually nvm...Here is the data
Ok I fixed it by changing the cast attribute. I thought Filament only tries to update fields that you set in the form :/
Thank you for your time 🙇♂️