Say I have this relationship
class Invitation { public function invitedPeople() { return $this->belongsTo('App\Person', 'personID'); } } class Person { public function apartments() { return $this->belongsToMany('App\Apartment', 'apartment_person', 'personID', 'apartmentID'); } } class Apartment { public function city() { return $this->belongsTo('App\City', 'cityID'); } }
My question here is how many nested levels do we have when using Laravel with impatience? I tried this request and it does not work, can anyone suggest a job for this?
return Invitation::with(['invitedPeople', 'invitedPeople.apartments', 'invitedPeople.apartments.city'])
source share