laravel relation of relation code example
Example: laravel relation of relation
//Multiple relationships:
$books = Book::with('author', 'publisher')->get();
//Nested relationships:
$books = Book::with('author.contacts')->get();
//Multiple relationships:
$books = Book::with('author', 'publisher')->get();
//Nested relationships:
$books = Book::with('author.contacts')->get();