name('password.request'); Route::post('password/reset', 'Auth\ResetPasswordController@postReset')->name('password.reset'); Route::get('/po-approval', function(){ $approvedInvoices = InvoiceStatuses::where('status', 'approve')->distinct()->get(['invoice_id'])->pluck('invoice_id'); $invoices = \App\Invoice::whereNotIn('id', $approvedInvoices)->whereNotNull('po_number')->get(); echo "

Total PO Pending Approval:".count($invoices)."

"; foreach ($invoices as $invoice){ echo "".$invoice->booking->id."
"; } })->name('po.approval'); Route::get('/old-invoices', function(){ $bookings = \App\Booking::where('status', 6)->whereHas('purchaseOrder', function($q){ $q->whereNotNull('image_path'); })->get(); $months = $bookings->groupBy(function($item) { return $item->created_at->format('Y-m'); }); echo "

Total pending invoices:".count($bookings)."

"; foreach ($months as $month => $bookings) { echo "

".$month."(".count($bookings).")


"; foreach ($bookings as $booking) { echo "".$booking->id." date: ".$booking->created_at."
"; } echo "


"; } })->name('invoice.old'); Route::group(['middleware' => ['role:admin']], function() { Route::get('bulkBookings', function () { return view('booking.bulkBooking'); })->name('booking.bulk.form'); Route::post('/bulkBookings', 'BulkBookingController@index')->name('booking.bulk'); }); Route::get('{path}', 'WelcomeController@index')->where('path', '(.*)'); Auth::routes(); //Route::get('/home', 'WelcomeController@index')->name('home');