I need to perform a left outer join between two tables in my database. Can anyone guide me on how to do a left outer join using Laravel’s Eloquent ORM or Query Builder?
To perform a left outer join in Laravel, you can just use leftJoin
. Assuming you have two tables, let’s call them left_table
and right_table
, and you want to perform a left outer join between them:
->leftJoin('right_table', 'left_table.id', '=', 'right_table.left_id')