Answer the question
In order to leave comments, you need to log in
Laravel. How to use leftJoin?
Good afternoon.
I have this sql query:
SELECT * FROM books AS e LEFT JOIN authors AS s ON e.authorid = s.id WHERE e.type = 2 AND s.authorid = 1
$beginGames = event::where('books.type', '=', DB::raw(2))
->leftJoin('authors as authors', 'authors.authorsid', '=', DB::raw(1))
->get();
select * from `books` left join `authors` as `authors` on `authors`.`authorid` = 1 where `books`.`type` = 2
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question