diff --git a/routes/web.php b/routes/web.php index 1e6a43f2..f97719d8 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,5 +1,7 @@ name('password.request'); Route::post('password/reset', 'Auth\ResetPasswordController@postReset')->name('password.reset'); Route::get('/old-invoices', function(){ - $bookings = \App\Booking::select('id', 'created_at',DB::raw('YEAR(created_at) year, MONTH(created_at) month'))->where('status', 6)->whereHas('purchaseOrder', function($q){ + $bookings = \App\Booking::where('status', 6)->whereHas('purchaseOrder', function($q){ $q->whereNotNull('image_path'); - })->groupby('year','month')->get(); - dd($bookings); + })->get(); + dd($bookings->groupBy(function($item) { + return Carbon::createFromFormat('Y-m-d', $item->date)->format('Y-W'); + })); echo "