Answers for "how to use group by in join query in laravel 8"

PHP
4

group by laravel

$user_info = DB::table('usermetas')
                 ->select('browser', DB::raw('count(*) as total'))
                 ->groupBy('browser')
                 ->get();
Posted by: Guest on August-06-2020
1

group_concat laravel

$assignment_details = $assignment->raw_plan()
                                ->select('raw_plans.*', DB::raw('group_concat(name) as names'))
                                ->where('assignment_id', 1)
                                ->groupBy('flag')
                                ->get();
Posted by: Guest on July-16-2020

Code answers related to "how to use group by in join query in laravel 8"

Browse Popular Code Answers by Language