osb/routes/web.php

125 lines
5.2 KiB
PHP
Raw Permalink Normal View History

2017-11-03 05:26:07 +00:00
<?php
use Leenooks\Controllers\AdminController as LeenooksAdminController;
use App\Http\Controllers\{AdminController,
Auth\LoginController,
2021-06-30 23:21:18 +00:00
CheckoutController,
HomeController,
MediaController,
2021-07-09 01:39:27 +00:00
OrderController,
PaypalController,
SearchController,
ServiceController,
WelcomeController};
2021-06-28 01:06:44 +00:00
2017-11-03 05:26:07 +00:00
/*
|--------------------------------------------------------------------------
| Web Routes
2017-11-03 05:26:07 +00:00
|--------------------------------------------------------------------------
|
| 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!
2017-11-03 05:26:07 +00:00
|
*/
2018-07-31 04:11:00 +00:00
Auth::routes();
2021-06-30 23:21:18 +00:00
Route::get('/logout',[LoginController::class,'logout']);
2019-09-03 04:43:59 +00:00
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');
2019-09-03 04:43:59 +00:00
});
2017-12-04 12:37:14 +00:00
// Generic Image Renderer - Render images that we dont have with a generic image
Route::get('image/generic/{width}/{height}/{color}/{name?}',[MediaController::class,'image'])->name('image');
2017-12-04 12:37:14 +00:00
2018-07-31 04:11:00 +00:00
// Our Admin Routes
Route::group(['middleware'=>['theme:adminlte-be','auth','role:wholesaler'],'prefix'=>'a'],function() {
Route::match(['get','post'],'setup',[AdminController::class,'setup']);
// Route::get('service/{o}','AdminHomeController@service');
// Route::post('service/{o}','AdminHomeController@service_update');
// Route::get('report/products','Wholesale\ReportController@products');
Route::match(['get','post'],'payment/add',[AdminController::class,'pay_add']);
Route::post('service/edit/{o}',[ServiceController::class,'domain_edit'])
->where('o','[0-9]+')
->middleware('can:update,o');
//Route::get('accounting/connect','AccountingController@connect');
});
2018-05-20 12:53:14 +00:00
Route::get('admin/switch/stop',[LeenooksAdminController::class,'user_switch_stop'])->name('switch.user.start')->middleware('auth');
2018-08-01 07:09:38 +00:00
2018-07-31 04:11:00 +00:00
// 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}',[LeenooksAdminController::class,'user_switch_start'])->name('switch.user.stop');
// Route::match(['get','post'],'service/update/{o}','ServiceController@update')
// ->where('o','[0-9]+')
// ->middleware('can:update,o');
Route::group(['middleware'=>['theme:adminlte-be','auth','role:reseller'],'prefix'=>'report'],function() {
Route::get('domain',[ServiceController::class,'domain_list']);
});
2018-07-31 04:11:00 +00:00
});
// Our User Routes
Route::group(['middleware'=>['theme:adminlte-be','auth'],'prefix'=>'u'],function() {
2021-06-28 01:06:44 +00:00
Route::get('home',[HomeController::class,'home']);
2021-06-29 06:36:34 +00:00
Route::get('home/{o}',[HomeController::class,'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::class,'pay']);
2021-06-29 06:36:34 +00:00
Route::get('invoice/{o}',[HomeController::class,'invoice'])
->where('o','[0-9]+')
->middleware('can:view,o');
2021-06-29 06:36:34 +00:00
Route::get('invoice/{o}/pdf',[HomeController::class,'invoice_pdf'])
2020-07-27 04:49:59 +00:00
->where('o','[0-9]+')
->middleware('can:view,o');
Route::get('invoice/cart',[CheckoutController::class,'cart_invoice']);
Route::get('invoice/cart/{o}',[CheckoutController::class,'cart_invoice'])
->where('o','[0-9]+')
->middleware('can:view,o');
2021-06-29 06:36:34 +00:00
Route::get('service/{o}',[HomeController::class,'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');
2018-07-31 04:11:00 +00:00
});
2020-05-25 07:45:17 +00:00
// 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}');
2020-05-25 07:45:17 +00:00
});
2018-07-31 04:11:00 +00:00
// Frontend Routes (Non-Authed Users)
Route::group(['middleware'=>['theme:metronic-fe']],function() {
2021-06-28 01:06:44 +00:00
Route::get('/',[WelcomeController::class,'home']);
2021-07-09 01:39:27 +00:00
Route::get('order',[OrderController::class,'index']);
Route::post('order',[OrderController::class,'submit']);
2018-05-20 12:53:14 +00:00
});
2021-07-09 01:39:27 +00:00
Route::get('product_order/{o}',[OrderController::class,'product_order']);
Route::get('product_info/{o}',[OrderController::class,'product_info']);
2020-07-27 04:49:59 +00:00
Route::redirect('home','u/home');
Route::get('search',[SearchController::class,'search']);
Route::get('pay/paypal/authorise',[PaypalController::class,'authorise']);
Route::get('pay/paypal/cancel',[PaypalController::class,'cancel']);
Route::get('pay/paypal/capture',[PaypalController::class,'capture']);
2021-06-29 00:37:24 +00:00
// To access any routes protected by demo-mode.
Route::demoAccess('uc-access');