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
@@ -926,6 +927,33 @@ protected function casts(): array
926
927
}
927
928
```
928
929
930
+
<aname="comparing-cast-values"></a>
931
+
### Comparing Cast Values
932
+
933
+
If you would like to define how two given cast values should be compared to determine if they have been changed, your custom cast class may implement the `Illuminate\Contracts\Database\Eloquent\ComparesCastableAttributes` interface. This allows you to have fine-grained control over which values Eloquent considers changed and thus saves to the database when a model is updated.
934
+
935
+
This interface states that your class should contain a `compare` method which should return `true` if the given values are different:
0 commit comments