1
2->leftJoin('table3 AS c', function($join){
3 $join->on('a.field2', '=', 'c.field2')
4 ->where('a.field2', '=', true)
5 ->where('a.field3', '=', 'c.field3');
6})
1//Left join
2$users = DB::table('users')
3 ->leftJoin('posts', 'users.id', '=', 'posts.user_id')
4 ->get();
5//Right join
6$users = DB::table('users')
7 ->rightJoin('posts', 'users.id', '=', 'posts.user_id')
8 ->get();