diff --git a/routes/web.php b/routes/web.php index 150afdda..05127e7a 100644 --- a/routes/web.php +++ b/routes/web.php @@ -27,8 +27,12 @@ Route::get('/report/x1', function(){ }); foreach($months as $month => $bookings){ - dd($bookings->map(function ($row) { return $row->sum('bia'); })); - echo "

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


"; + $total = 0; + foreach ($bookings as $booking){ + $total += $booking->bia; + } + dd($total); +// echo "

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


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