I had a similar issue in my project and this is how I solved it using the query builder
DB::table('books')
->join('genres', 'books.genre_id', '=', 'genres.id')
->join('formats', 'books.format_id', '=', 'formats.id')
->join('author_books', 'author_books.book_id', '=','books.id')
->join('authors', 'authors.id', '=','author_books.author_id')
->orderBy('authors.last_name')
->orderBy('authors.first_name')
->get();
In plain SQL it would look something loke this
"select * from `books` inner join `genres` on `books`.`genre_id` = `genres`.`id` inner join `formats` on `books`.`format_id` = `formats`.`id` inner join `author_books` on `author_books`.`book_id` = `books`.`id` inner join `authors` on `authors`.`id` = `author_books`.`author_id` order by `authors`.`last_name` asc, `authors`.`first_name` asc"