Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Laravel 8 query builder, Left Join / Right Join Clause

//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();
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #Laravel #query #Left #Join #Right #Join #Clause
ADD COMMENT
Topic
Name
5+5 =