This repository has been archived by the owner on Jul 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Alias for eager loading #2183
Comments
Totally agreed! Such behaviour already exists for relationships counts, and just have to exist on relationships themselves https://laravel.com/docs/8.x/eloquent-relationships#counting-related-models |
+1 |
Duplicate of #1396 |
+1 |
There have already been pull requests PR #31976 |
+1 |
+1 |
1 similar comment
+1 |
there is a pr made recently here: laravel/framework#37656 🙏 |
Good luck |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi. My problem is that I need something like an alias for eager loading in case when I use same relation. For example imagine if I have cms with leads. Every lead has the responsible manager. I wanna get analytics of managers with different constrains

This code doesn't work
So I have to create two relations with same code inside

Maybe I'll need to have another request to the same Lead model so I need to create one more method with the same logic inside. What could be an alternative solution?
The text was updated successfully, but these errors were encountered: