Laravel Group By Week

->groupBy(function($date) {
  return Carbon::parse($date->created_at)->format('W');
});

Didn’t know Carbon parse has a ‘W’ format!

Leave a Comment