mutateFormDataBeforeCreate does not add the field to the query
Hello,
I am currently trying to add the user_id to the form array when a user creates a new entry.
In the Create class of the Filament recourse I have this:
For some reason, the query is this:
SQLSTATE[HY000]: General error: 1364 Field 'user_id' doesn't have a default value
What am I doing wrong?
3 Replies
fixed it. I forgot to add user_id to the fillable array.
I recommend you to put Model::unguard() inside the boot() method at AppServiceProvider. Never more you'll have that headache
better not