Relation of relation Laravel

PHOTO EMBED

Fri Jun 11 2021 20:56:52 GMT+0000 (Coordinated Universal Time)

Saved by @jeromew #php #laravel

//Multiple relationships:
$books = Book::with('author', 'publisher')->get();

//Nested relationships:
$books = Book::with('author.contacts')->get();
content_copyCOPY