//Left join
$users = DB::table('users')
->leftJoin('posts', 'users.id', '=', 'posts.user_id')
->get();
//Right join
$users = DB::table('users')
->rightJoin('posts', 'users.id', '=', 'posts.user_id')
->get();
->leftJoin('table3 AS c', function($join){
$join->on('a.field2', '=', 'c.field2')
->where('a.field2', '=', true)
->where('a.field3', '=', 'c.field3');
})
$result = DB::table('pos_cash_register_open')
->select('pos_cash_register_open.outlet_id','pos_outlets.*')
->leftjoin('pos_outlets', 'pos_cash_register_open.outlet_id', '=', 'pos_outlets.id')
->groupBy('pos_cash_register_open.outlet_id')
->get();