Field not updating in database, but shows successful update
Why wouldn't this field be getting updated in the database?
The update is being sent to the server and shows a 200 response, but the database isn't updated. I don't know if it has to do with the relationship. The location has a related config model where the field lives. I can DD the $config inside the
afterStateUpdated
method and it's showing the config model. It seems like it should be automatically updating the field without having to do the afterStateUpdated thing, but even with that it's not updating the database.5 Replies
Just checking, is the field in the fillable array of your model?
I have my models unguarded, but I just added the fillable array just to test it and it's still not working.
I had this once too. Are you filling on the mount? And finally. try as a test:
$this->form->model($this->location)->saveRelationships();
within save function? This worked for me prior to having my form booted correctly.
I am running
$this->form->fill()
in my mount method.
Do you just mean like this:
That's not having any effect either.
Was trying to have it just save automatically, but maybe I just need to add a save button and move on...
If I attach the whole file, is someone willing to take a look and see if I'm missing something? I feel like this should be pretty straight-forward.Can you put the resource and models etc in a git so we can pull it down and test