I was hoping to prevent a log occurring on a model "updating" event if the change only happened to a particular attribute. For example, I have a datetime field in a user model that I don't want to log changes to, and therefore don't want an activitylog entry if the changes only happened to that field.
Defining the $logAttributes property determines what gets stored for a model, but I can't see if any comparison actually happens to see if anything has actually changed.
Is there currently a way to do this?
No, you need to compare old and attributes yourself.
For diff the 2 values, a little shortcode..
collect($changes->get('attributes'))->diff($changes->get('old'))
returns only the changed properties and values
Most helpful comment
For diff the 2 values, a little shortcode..
returns only the changed properties and values