If you are looking to get rows created each day for a particular Model in your database, here is how you can achieve this. For this example, I have a User model, and I am looking to get the count of users created each day. User->all()->countBy(function($item) { return $item->created_at->format('Y-m-d'); }); You can also apply the date range in which you want to get the results User::where('created_at', '>=', $date_from) ->where('created_at', ' get()->countBy(function($item) { return $item->created_at->format('Y-m-d'); });
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners