-
Notifications
You must be signed in to change notification settings - Fork 81
How to eager load relations? #119
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
Comments
At the moment See:
|
I thought so... this takes away one of the greatest advantages of using Laravel, the fact that I can load related content basically on the fly. |
I am experiencing large performance issues with taxonomies. I now see that "with" is not implemented. This is not going to be implemented? |
There are no plans to implement it. |
Would it mess things up if we stored the taxonomy IDs with the entry instead of handles? I think that would allow for a taxonomy relationship to the Entry model. |
Not sure I’m following what you mean? |
Preface: I'm still working on my first Statamic site, so I don't have a super great grasp of the inner workings yet. 😄 If you create your own models there's nothing preventing you from adding relations on the Entry model. Would it be possible then to create a taxonomy relationship and I guess a pivot if require. Rather than storing taxonomies in the entry by handle you could grab them by ID.
I think this approach would end up being situational though because the data column doesn't know that categories is a taxonomy without referencing some other tables. |
A term ID is just the slug/handle prefixed with the taxonomy handle. So you could do this as is. Longer term I'm hoping some changes in core will allow this driver to use proper pivot tables. |
I try to load a page and the associated taxonomies terms of it but the problem is that extra queries are being done.
I am using Statamic multisite.
I would like to be able to eager load only those associated with that specific entry.
So I have a tags taxonomy and I want something like:
Many thanks
The text was updated successfully, but these errors were encountered: