laravel count by date

Solutions on MaxInterview for laravel count by date by the best coders in the world

showing results for - "laravel count by date"
Salomé
14 Nov 2020
1    $usersData = User::select(DB::raw('DATE(created_at) as date'), DB::raw('count(*) as total'))
2            ->groupBy('date')
3            ->orderBy('date', 'desc')
4            ->take(7)
5            ->get();