Skip to content
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

[ORM] Optimise ModelQueryBuilder::with for nested relations #246

Open
woru opened this issue Aug 25, 2016 · 1 comment
Open

[ORM] Optimise ModelQueryBuilder::with for nested relations #246

woru opened this issue Aug 25, 2016 · 1 comment

Comments

@woru
Copy link
Member

woru commented Aug 25, 2016

User::where(...)->with('role->group')

could load user's roles and roles' groups with one query.
We can analyze nested relation in 'with' and if they are of type belongsTo or hasOne (collection=false) join them instead of issuing separate queries.

@woru
Copy link
Member Author

woru commented Aug 25, 2016

I mean join roles and groups, not users, roles and groups

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant