$groups = DB::table('groups') //$groupsは変数にいれてるだけ ->leftJoin('users', 'groups.id', '=', 'users.group_id') ->select('groups.id', 'groups.name', DB::raw("count(users.group_id) as count")) ->groupBy('groups.id') ->get(); ・外部結合は leftjoin()(内部結合...
Laravelのトランザクション処理の基本と使用方法にご興味のある方にはこちらをおすすめします。Kinstaの知識ベースに答えがあります。
どうして動く? Register as a new user and use Qiita more conveniently You get articles that match your needs You can efficiently read back useful information You can use dark theme What you can do with signing up Sign upLogin 関連記事Recommended by ...