📜  左连接 laravel - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:35.295000             🧑  作者: Mango

代码示例6
$users = DB::table('users')
            ->leftJoin('posts', 'users.id', '=', 'posts.user_id')
            ->get();

$users = DB::table('users')
            ->rightJoin('posts', 'users.id', '=', 'posts.user_id')
            ->get();