Save a field when creating a model

Hello, I have a casts field in my model and I want to save two other fields into the particular field.
This question is similar ❓┊helpCustom value for field (fill and save field with custom table column) but the provided solution does not work for me while using
mutateFormDataBeforeCreate
The field I want I can set it inside
mutateFormDataBeforeCreate
but it fails
SQLSTATE[HY000]: General error: 1364 Field 'myField' doesn't have a default value
.
How can I save into this field on creation?
Thank you.
Was this page helpful?