-
-
Notifications
You must be signed in to change notification settings - Fork 133
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
Laravel upgrade - Cannot access distant relations anymore #161
Comments
Can you please share a code example of querying A and it's children relations A.B.C? I also suggest to check the query log (via Laravel Debugbar or ...) to get an idea of the SQL queries. |
Sure @topclaudy The below is the relation from what I referred as Model A (\App\Contract), it hasMany \App\PickupPoint (model B) joining on the tender_ref_no column. I am trying to eager load all PickupTime (model C) for each PickupPoint. When I remove the
The queries running
then basically thousands of lines like this with huge bindings array with all Contract(s) and PickupPoint(s) IDs
Thanks again |
@sptdigital Thanks for the follow-up. |
You shouldn't use |
Hi there,
First of all thank you for having maintained the library for so long it has been great so far.
Today I was trying to upgrade our Laravel to version 8 (from 6...) but the app breaks partially where trying to eager load distant relations on models implementing compoships.
I am trying to understand what's going on or what I am doing wrong.
Current versions
Laravel: 8.83
Compoships: 2.0.5 (tried 2.0.3 and also the latest too)
all relations where using compoship are belongsTo or hasMany
I have these 3 models with relations defined as below, all tables having 50K+ records
The response I used to get in L6 when querying A and it's children relations A.B.C
The response I am getting now
I have tested all relations individually on a direct parent > child basis and they all work, so requesting A > B or B > C works but when trying to nest A B C fails with the query trying to get all the B's fron the Database regardless of the parent relation with A
Any hint would be appreciated
Thanks
The text was updated successfully, but these errors were encountered: