You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but for many jobs, this type of lazy loading doesn't seem to be very scalable. Is it also possible to eager load relationships on the pivot model with the with() function for instance?
EDIT
I also tried to get the status using an inner join, but since my custom join occurs after the join of the pivot table to the Job table, the variable job_states.status_id cannot yet be resolved:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to figure out a way to load a relationship that is defined on a pivotModel. Let's say I have the following models:
How can I indicate that the
status
relationship of JobState also needs to be loaded? I have found a way by doing something likebut for many jobs, this type of lazy loading doesn't seem to be very scalable. Is it also possible to eager load relationships on the pivot model with the
with()
function for instance?EDIT
I also tried to get the status using an inner join, but since my custom join occurs after the join of the pivot table to the Job table, the variable
job_states.status_id
cannot yet be resolved:so sadly, this approach is not possible
Beta Was this translation helpful? Give feedback.
All reactions