-
-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compare raw attributes only when ensuring uniqueness of paginated related models #2540
Conversation
963bd3a
to
3bde0a2
Compare
@spawnia Hi, this breaks when Models have native Enum casted attributes. |
Hm, the best would actually be to pick |
That would be |
@skaesdorf great, can you raise a PR for that? |
Changes
Right now,
toJson
is used which "is recursive, so all attributes and relations will be converted to JSON" (see https://laravel.com/docs/11.x/eloquent-serialization#serializing-to-json). This means that all accessors are executed as well which can affect the performance of an application. The new approach simply compares the raw attributes of the models which should be enough in almost all cases as far as I can see.Breaking changes
There might be a tiny chance that something doesn't work as before because accessors are not compared anymore.