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
When logging model events, only enums and date casts are currently implemented. In my case, for example, I use a custom cast for a money object. The actual value is stored as an integer in the database, but the ActivityLog model stores this property in the array representation of the money object.
I would like to be able to handle the changes in exactly the same way as the actual model attributes. If necessary, I could even query relationships.
Some examples:
// Accessing an enum$activity->changes()->old('interval')->label();
$activity->changes()->new('interval')->label();
// Accessing money object$activity->changes()->old('amount')->formatTo('de_DE');
// Maybe accessing a relationship, when user_id was changed$activity->changes()->old('user')->name;
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
When logging model events, only enums and date casts are currently implemented. In my case, for example, I use a custom cast for a money object. The actual value is stored as an integer in the database, but the ActivityLog model stores this property in the array representation of the money object.
I would like to be able to handle the changes in exactly the same way as the actual model attributes. If necessary, I could even query relationships.
Some examples:
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions