Describe the bug
If I use a model with guarded attributes instead of fillable, then I get an error when trying to save changed attributes of the base model. This behavior occurs only after accessing the translation field through a mutator. When accessed through a mutator, the translation attribute is stored in the model attributes and when getDirty is called, it starts to return.
To Reproduce
Create model with guarded attributes and mutator for translation field.
Get translation field via mutator
Try to change some field of model and save
Expected behavior
Save changes of base model instead exception
Versions (please complete the following information)
PHP: 8.1
Exception
General error: 1 no such column: name (Connection: testing, SQL: update "cities" set "category" = some_category, "name" = Oslo, "locale" = En, "updated_at" = 2023-02-24 10:06:00 where "id" = 1)
name is translation field.
Describe the bug If I use a model with guarded attributes instead of fillable, then I get an error when trying to save changed attributes of the base model. This behavior occurs only after accessing the translation field through a mutator. When accessed through a mutator, the translation attribute is stored in the model attributes and when getDirty is called, it starts to return.
To Reproduce
Expected behavior Save changes of base model instead exception
Versions (please complete the following information)
Exception General error: 1 no such column: name (Connection: testing, SQL: update "cities" set "category" = some_category, "name" = Oslo, "locale" = En, "updated_at" = 2023-02-24 10:06:00 where "id" = 1) name is translation field.