1use Illuminate\Support\Facades\DB;
2
3$users = DB::table('users')
4 ->join('contacts', 'users.id', '=', 'contacts.user_id')
5 ->join('orders', 'users.id', '=', 'orders.user_id')
6 ->select('users.*', 'contacts.phone', 'orders.price')
7 ->get();
1 $select->joinSub(
2 $selectSubQry,
3 'ag',
4 'ag.id',
5 '=',
6 'agp.userId'
7 );