-
Notifications
You must be signed in to change notification settings - Fork 11.4k
[12.x] Add Support for Selective Relationship Autoloading in withRelationshipAutoloading #55673
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
[12.x] Add Support for Selective Relationship Autoloading in withRelationshipAutoloading #55673
Conversation
Thanks for submitting a PR! Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface. Pull requests that are abandoned in draft may be closed due to inactivity. |
|
} | ||
} | ||
|
||
$this->loadMissingRelationshipChain($tuples); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo: this part will be modified, can be improved overall
Not sure if its worth the complexity it adds up, abondening for now. |
This PR adds support for selective column loading in
withRelationshipAutoloading
, similar to howwith('client:id,name')
works.Please refer to withRelationshipAutoloading
With this enhancement, you can now specify which columns to load for a relationship, improving query performance by only retrieving the necessary data.
For example:
Note
Backward compatibility is preserved:
When no columns are specified for a relationship, all columns continue to load by default. Other relationships continue autoloading as expected without needing to be explicitly defined.