Hitung datetime yang sama di foreach dan kelompokkannya PHP
$matchs = DiraChatLog::where('status','=','Match')->whereBetween('date_access', [$request->from, $request->to])->get();
$array[] = [];
foreach ($matchs as $key => $match) {
$day = substr($match->date_access, 0, 10);
if(isset($array[$day])){
$array[$day]++;
}else{
$array[$day] = 1;
}
}
dd($array);
Energetic Echidna