lundi 26 décembre 2016

How to count articles for every months in current year?

I have list of months, and now i want to count articles for every month. I have this :

$data= Articles::get()
          ->groupBy(function($item) {
          return $item->created_at->month;
      });

And for now i get data for 11 and 12, but how can i do that so that i can have list of month names and next to them have number of articles for that month?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire