From 8fc2fcaa90466ed8740708ac5bdb5098517b52da Mon Sep 17 00:00:00 2001 From: omair saleh Date: Sat, 5 Dec 2020 11:42:33 +0800 Subject: [PATCH] x1 and x2 reports --- routes/web.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/routes/web.php b/routes/web.php index 05127e7a..2430a684 100644 --- a/routes/web.php +++ b/routes/web.php @@ -27,11 +27,9 @@ Route::get('/report/x1', function(){ }); foreach($months as $month => $bookings){ - $total = 0; - foreach ($bookings as $booking){ - $total += $booking->bia; - } - dd($total); + dd($bookings->map(function($booking){ + return +$booking->bia; + })); // echo "

".$month."(".$bookings->map(function ($row) { return $row->sum('bia'); }).")


"; $day = $bookings->groupBy(function($item){ return $item->created_at->format('Y-m-d');