osb/routes/web.php
2021-06-29 16:40:54 +10:00

111 lines
4.6 KiB
PHP

<?php
use App\Http\Controllers\{HomeController,WelcomeController};
/*
|--------------------------------------------------------------------------
| 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!
|
*/
Auth::routes();
Route::get('/logout','Auth\LoginController@logout');
Route::group(['middleware'=>['theme:adminlte-be']],function() {
Route::get('auth/{socialProvider}','Auth\SocialLoginController@redirectToProvider');
Route::get('auth/{socialProvider}/callback','Auth\SocialLoginController@handleProviderCallback');
Route::get('auth/{socialProvider}/link','Auth\SocialLoginController@link');
Route::post('auth/{socialProvider}/linkcomplete','Auth\SocialLoginController@linkcomplete');
});
// Generic Image Renderer - Render images that we dont have with a generic image
Route::get('image/generic/{width}/{height}/{color}/{name?}','MediaController@image')->name('image');
// Our Admin Routes
Route::group(['middleware'=>['theme:adminlte-be','auth','role:wholesaler'],'prefix'=>'a'],function() {
Route::get('setup','AdminHomeController@setup');
Route::post('setup','AdminHomeController@setup_update');
Route::get('service/{o}','AdminHomeController@service');
Route::post('service/{o}','AdminHomeController@service_update');
Route::get('report/products','Wholesale\ReportController@products');
Route::get('payment/add','PaymentController@add');
//Route::get('accounting/connect','AccountingController@connect');
});
Route::get('admin/switch/stop','\Leenooks\Controllers\AdminController@user_switch_stop')->name('switch.user.start')->middleware('auth');
// Our Reseller Routes
Route::group(['middleware'=>['theme:adminlte-be','auth','role:reseller'],'prefix'=>'r'],function() {
Route::get('supplier/index','SuppliersController@index');
Route::get('supplier/create','SuppliersController@create');
Route::post('supplier/store','SuppliersController@store');
Route::get('switch/start/{id}','\Leenooks\Controllers\AdminController@user_switch_start')->name('switch.user.stop');
Route::match(['get','post'],'service/update/{o}','ServiceController@update')
->where('o','[0-9]+')
->middleware('can:update,o');
});
// Our User Routes
Route::group(['middleware'=>['theme:adminlte-be','auth'],'prefix'=>'u'],function() {
Route::get('home',[HomeController::class,'home']);
Route::get('home/{o}','UserHomeController@home')
->where('o','[0-9]+')
->middleware('can:view,o');
Route::get('account/{o}/invoice','User\AccountController@view_invoice_next')
->where('o','[0-9]+')
->middleware('can:view,o');
Route::post('checkout/pay','CheckoutController@pay');
Route::get('invoice/{o}','UserHomeController@invoice')
->where('o','[0-9]+')
->middleware('can:view,o');
Route::get('invoice/cart','CheckoutController@cart_invoice');
Route::get('invoice/cart/{o}','CheckoutController@cart_invoice')
->where('o','[0-9]+')
->middleware('can:view,o');
Route::get('invoice/{o}/pdf','UserHomeController@invoice_pdf')
->where('o','[0-9]+')
->middleware('can:view,o');
Route::get('service/{o}','UserHomeController@service')
->where('o','[0-9]+')
->middleware('can:view,o');
Route::get('service/cancel/{o}','ServiceController@update')
->where('o','[0-9]+')
->middleware('can:update,o');
Route::get('service/progress/{o}/{status}','UserHomeController@service_progress')
->where('o','[0-9]+')
->middleware('can:progress,o,status');
});
// Doorman Code Routes
Route::group(['middleware'=>['theme:adminlte-be'],'prefix'=>'u'],function() {
Route::get('invoice/{o}/email/{code}','UserHomeController@invoice_pdf_email')
->where('o','[0-9]+')
->where('code','[0-9A-Z]{6}');
});
// Frontend Routes (Non-Authed Users)
Route::group(['middleware'=>['theme:metronic-fe']],function() {
Route::get('/',[WelcomeController::class,'home']);
Route::get('order','OrderController@index');
Route::post('order','OrderController@submit');
});
Route::get('product_order/{o}','OrderController@product_order');
Route::get('product_info/{o}','OrderController@product_info');
Route::redirect('home','u/home');
Route::demoAccess('uc-access');
Route::redirect('under-construction','http://www.graytech.net.au');
Route::get('u/{type}/{action}/{id}','UserHomeController@oldsite');
Route::get('search','SearchController@search');
Route::get('pay/paypal/authorise','PaypalController@authorise');
Route::get('pay/paypal/cancel','PaypalController@cancel');
Route::get('pay/paypal/capture','PaypalController@capture');