dimanche 1 mars 2015

Laravel ORM nested relationships with constraints


Vote count:

0




I'm wondering how to perform a nested relationship query with constraints in Laravel 4.1.


Here is a reference query which works:



$users = User::with("careers.specialty.faculty.university")->get();


As you can see, there are several nested models (with various relation types).


I would like to load an optional constraint to one or several models, for instance a faculty name...


What would be the best (and simplest) way to achieve this?



asked 55 secs ago

Yako

1,009






Laravel ORM nested relationships with constraints

Aucun commentaire:

Enregistrer un commentaire