leftJoin select and createa rray larvel code example
Example 1: left join laravel
$users = DB::table('users')
->leftJoin('posts', 'users.id', '=', 'posts.user_id')
->get();
$users = DB::table('users')
->rightJoin('posts', 'users.id', '=', 'posts.user_id')
->get();
Example 2: DB::table('users')->get(); id 1
$users = DB::table('users')where('id','=', $userid)->get();