i want to get the value name in created_at field
i have the code like this
public function index()
{
$month = ['01','02','03','04'];
// $month = ['january','february','march','april'];
$user = [];
foreach ($month as $key => $value) {
$user[] = User::where(\DB::raw("DATE_FORMAT(created_at, '%m')"),$value)->count();
}
return view('AdmPelatihan.Dashboard.index')->with('month',json_encode($month))->with('user',json_encode($user));
}
i want make it like 01 = januari, dst