having and group by in laravel code example
Example 1: group by laravel
$user_info = DB::table('usermetas')
->select('browser', DB::raw('count(*) as total'))
->groupBy('browser')
->get();
Example 2: laravel multiple group by
$routes = DB::table('route')
->groupBy('rte_origin', 'rte_destination')
->get();