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$users = User::join('posts', 'posts.user_id', '=', 'users.id')
2 ->where('users.status', 'active')
3 ->where('posts.status','active')
4 ->get(['users.*', 'posts.descrption']);
1$users = User::join('posts', 'posts.user_id', '=', 'users.id')
2 ->where('users.status', 'active')
3 ->where('posts.status','active')
4 ->get(['users.*', 'posts.descrption']);
5