From 0588f240a967a8cf7103a02de43e54c57c818206 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Sat, 9 Jan 2021 11:12:18 +0800 Subject: [PATCH] show active customers in the report --- routes/web.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/web.php b/routes/web.php index 0cc4fce5..f9184d71 100644 --- a/routes/web.php +++ b/routes/web.php @@ -29,7 +29,7 @@ Route::group(['middleware' => ['role:admin']], function() { }); foreach($months as $month => $bookings){ - $newCustomers = \App\User::whereYear('created_at', '=', Carbon::parse($month)->format('Y')) ->whereMonth('created_at', '=', Carbon::parse($month)->format('Y'))->get(); + $newCustomers = \App\User::whereYear('created_at', '=', Carbon::parse($month)->format('Y')) ->whereMonth('created_at', '=', Carbon::parse($month)->format('m'))->get(); echo "

".Carbon::parse($month)->format('m-Y').": ".$bookings->sum('bia')." MYR

"; echo "

New Customer: ".count($newCustomers)." Customers

"; echo "

Active Customers: ".count($bookings->groupBy(function($item){