Replies: 1 comment 1 reply
-
Hey, I think that we could add a Something like that should handle all cases. if ($old instanceof DateInterval) {
return CarbonInterval::make($old)->equalTo($new);
} elseif ($new instanceof DateInterval) {
return CarbonInterval::make($new)->equalTo($old);
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Ran into an issue today related to trying to log changes to a DTO-casted property that includes a
DateInterval
, which cannot be compared by PHP using the spaceship operator and thus causes anErrorException
.In general we use this approach to all of our models for logging changes:
Of course, we could add this property to
logAttributesToIgnore
and never log changes to it.However, I wonder if activitylog should catch the exception and assume that a property that cannot be compared has changed? I'm posting as a discussion as I'm not even sure if I'm right, and this isn't a bug or feature request but more of a question!
Beta Was this translation helpful? Give feedback.
All reactions