get count of results based on groupBy laravel

77

$getUserCountries = User::select('country', DB::raw('count(*) as count'))
                          ->groupBy('country')
                          ->get()->
                          toArray();

Comments

Submit
0 Comments