Im using this laravel function to get all the invoices created during the past 30 days:

```
$invoice = Invoices::where('created_at', '>=', Carbon::now()->subMonth())->get();

```

That function return a collection of objects, what I want is to obtain an array of [creation day => how many where created on that day] for each one of the objects.

I was reading about array\_count\_values but that function doesn't work with collection objects.

Any help is appreciated.