Files
exchange/routes/web.php
T
2020-09-25 18:06:46 +08:00

40 lines
1.7 KiB
PHP

<?php
use Carbon\Carbon;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', 'WelcomeController@index');
Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.request');
Route::post('password/reset', 'Auth\ResetPasswordController@postReset')->name('password.reset');
Route::get('/old-invoices', function(){
$bookings = \App\Booking::where('status', 6)->whereHas('purchaseOrder', function($q){
$q->whereNotNull('image_path');
})->get();
dd($bookings->groupBy(function($item) {
return Carbon::createFromFormat('Y-m-d', $item->created_at)->format('Y-W');
}));
echo "<h1>Total pending invoices:<b>".count($bookings)."</b></h1>";
foreach ($bookings as $booking) {
echo "<a target='_blank' href='https://exchange.cief-malaysia.com/booking/".$booking->id."/upload-invoice'>".$booking->id."</a> <small>date: ".$booking->created_at."</small><br>";
}
})->name('home');
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');