You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a model with an array cast on one attribute foo.
protected$casts = [
'foo' => 'array',
];
But the SQL type is VARCHAR.
When the any of markApproved, markRejected, markPostponed, markPending is called, it causes the attributes array to be changed from
Ok I was able to fix it by changing the $new->attributesToArray() to $new->attributes in the Moderatable trait.
So the markApproved function for example changes to
koapeadu
changed the title
markApproved, markRejected, ... functions modify attributes with casts defined on them
markApproved, markRejected, ... functions incompatible with models with attributes with array casts
May 8, 2019
I have a model with an
array
cast on one attributefoo
.But the SQL type is
VARCHAR
.When the any of
markApproved
,markRejected
,markPostponed
,markPending
is called, it causes the attributes array to be changed fromto
which leads to unexpected value exceptions when trying to save the model
The text was updated successfully, but these errors were encountered: