dimanche 26 février 2017

How to get object from nested Eager Loading Laravel?

In query I use Nested Eager Loading:

$res = User::where("id", 1)->with("categories.categoryAnn.announcements")->get();

In result of this query I get nested collections:

Collection->User->categories->categoryAnn->announcements

How to shortly get last nested object announcements?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire