Replies: 1 comment
-
I remember reading something about this in 11.x or 12.x, Discussion of pull request. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
It is often handy to use $with inside the model to define which relations should be loaded by default. There are some nice possiblities with recursive relations to get the whole item path but also the risk of recursions in some cases with applications which use blameables.
My learning was $with is often bad - use with() instead to control the depth of your needed relations. Which results in a service or controller which builds up the loading options.
It would be sometimes handy to have a native way to define how deep the resolving should go on. Maybe an method which could be chained and which only resolves the desired depth. 0 = no eagerloading of the $with relations, 1 = eagerload $with relations of the first level, ...
Lazyloading should still be possible.
Beta Was this translation helpful? Give feedback.
All reactions