From 4494fcbc53df7516831d05dcf829f8951ec1a0c1 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Mon, 7 Dec 2020 11:50:37 +0800 Subject: [PATCH] pending customer po grouped by customer --- routes/web.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/routes/web.php b/routes/web.php index bc534d72..a6135e40 100644 --- a/routes/web.php +++ b/routes/web.php @@ -96,7 +96,9 @@ Route::group(['middleware' => ['role:admin']], function() { })->get(); $customers = $bookings->groupBy(function($item) { return $item->user_id; - })->order(); + })->sortBy(function($item){ + return count($item); + }); echo "

Total Po Pending Customer Update: ".count($bookings)."

"; foreach ($customers as $customer => $bookings) { echo "

".$customer."(".count($bookings).")


";