load Relationship laravel code example
Example 1: eloquent relationships
$roles = App\User::find(1)->roles()->orderBy('name')->get();
Example 2: laravel load relation on a relation
$books = Book::with('author.contacts')->get();
$roles = App\User::find(1)->roles()->orderBy('name')->get();
$books = Book::with('author.contacts')->get();