2017-11-03 05:26:07 +00:00
|
|
|
<?php
|
|
|
|
|
2021-07-13 02:31:56 +00:00
|
|
|
use Leenooks\Controllers\AdminController as LeenooksAdminController;
|
2021-07-01 09:41:12 +00:00
|
|
|
use App\Http\Controllers\{AdminController,
|
|
|
|
Auth\LoginController,
|
2021-07-13 05:00:01 +00:00
|
|
|
Auth\SocialLoginController,
|
2021-06-30 23:21:18 +00:00
|
|
|
CheckoutController,
|
2021-06-30 05:50:33 +00:00
|
|
|
HomeController,
|
2021-07-01 23:12:34 +00:00
|
|
|
MediaController,
|
2021-07-09 01:39:27 +00:00
|
|
|
OrderController,
|
2021-06-30 05:50:33 +00:00
|
|
|
PaypalController,
|
2022-04-02 07:06:34 +00:00
|
|
|
ProductController,
|
2021-07-02 04:35:43 +00:00
|
|
|
SearchController,
|
2021-07-13 02:31:56 +00:00
|
|
|
ServiceController,
|
2021-06-30 05:50:33 +00:00
|
|
|
WelcomeController};
|
2021-06-28 01:06:44 +00:00
|
|
|
|
2017-11-03 05:26:07 +00:00
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
2018-04-10 11:23:13 +00:00
|
|
|
| Web Routes
|
2017-11-03 05:26:07 +00:00
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
2018-04-10 11:23:13 +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();
|
2022-04-02 07:06:34 +00:00
|
|
|
Route::get('logout',[LoginController::class,'logout']);
|
2018-04-10 11:23:13 +00:00
|
|
|
|
2022-04-02 07:06:34 +00:00
|
|
|
// Account linking to OPENID host
|
2019-09-03 04:43:59 +00:00
|
|
|
Route::group(['middleware'=>['theme:adminlte-be']],function() {
|
2021-07-13 05:00:01 +00:00
|
|
|
Route::get('auth/{socialProvider}',[SocialLoginController::class,'redirectToProvider']);
|
|
|
|
Route::get('auth/{socialProvider}/callback',[SocialLoginController::class,'handleProviderCallback']);
|
|
|
|
Route::get('auth/{socialProvider}/link',[SocialLoginController::class,'link']);
|
|
|
|
Route::post('auth/{socialProvider}/linkcomplete',[SocialLoginController::class,'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
|
2021-07-01 23:12:34 +00:00
|
|
|
Route::get('image/generic/{width}/{height}/{color}/{name?}',[MediaController::class,'image'])->name('image');
|
2017-12-04 12:37:14 +00:00
|
|
|
|
2022-04-02 07:06:34 +00:00
|
|
|
// Our Admin Routes - for wholesalers
|
2020-02-06 22:11:02 +00:00
|
|
|
Route::group(['middleware'=>['theme:adminlte-be','auth','role:wholesaler'],'prefix'=>'a'],function() {
|
2021-12-20 03:25:43 +00:00
|
|
|
// Site Setup
|
2021-07-01 09:41:12 +00:00
|
|
|
Route::match(['get','post'],'setup',[AdminController::class,'setup']);
|
2022-04-02 07:06:34 +00:00
|
|
|
// Product Setup
|
|
|
|
Route::match(['get'],'product',[ProductController::class,'home']);
|
|
|
|
Route::match(['get','post'],'product/details/{o?}',[ProductController::class,'details']);
|
2021-12-20 03:25:43 +00:00
|
|
|
// Supplier Setup
|
2022-04-02 07:06:34 +00:00
|
|
|
// @todo Move to Supplier Controller
|
2021-12-20 03:25:43 +00:00
|
|
|
Route::match(['get'],'supplier',[AdminController::class,'supplier']);
|
2022-04-02 07:06:34 +00:00
|
|
|
Route::match(['get','post'],'supplier/details/{o?}',[AdminController::class,'supplier_addedit']);
|
2021-12-20 03:25:43 +00:00
|
|
|
|
2021-07-13 02:31:56 +00:00
|
|
|
// Route::get('service/{o}','AdminHomeController@service');
|
|
|
|
// Route::post('service/{o}','AdminHomeController@service_update');
|
|
|
|
// Route::get('report/products','Wholesale\ReportController@products');
|
2021-07-23 07:25:26 +00:00
|
|
|
|
2021-10-01 04:59:04 +00:00
|
|
|
// Charges
|
|
|
|
Route::match(['get','post'],'charge/addedit/{o?}',[AdminController::class,'charge_addedit']);
|
|
|
|
Route::get('charge/unprocessed',[AdminController::class,'charge_unprocessed']);
|
|
|
|
|
|
|
|
// Payments
|
2021-07-23 07:25:26 +00:00
|
|
|
Route::match(['get','post'],'payment/addedit/{o?}',[AdminController::class,'pay_addedit']);
|
|
|
|
Route::get('payment/unapplied',[AdminController::class,'pay_unapplied']);
|
|
|
|
|
2022-02-01 05:40:46 +00:00
|
|
|
Route::post('service/edit/{o}',[ServiceController::class,'update'])
|
2021-07-13 02:31:56 +00:00
|
|
|
->where('o','[0-9]+')
|
|
|
|
->middleware('can:update,o');
|
2020-02-06 22:11:02 +00:00
|
|
|
//Route::get('accounting/connect','AccountingController@connect');
|
2017-12-03 01:20:26 +00:00
|
|
|
});
|
2018-05-20 12:53:14 +00:00
|
|
|
|
2021-07-13 02:31:56 +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
|
2020-02-06 22:11:02 +00:00
|
|
|
Route::group(['middleware'=>['theme:adminlte-be','auth','role:reseller'],'prefix'=>'r'],function() {
|
2021-07-13 02:31:56 +00:00
|
|
|
// 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::group(['middleware'=>['theme:adminlte-be','auth','role:reseller'],'prefix'=>'report'],function() {
|
|
|
|
Route::get('domain',[ServiceController::class,'domain_list']);
|
2022-04-02 07:06:34 +00:00
|
|
|
Route::get('email',[ServiceController::class,'email_list']);
|
2021-07-13 02:31:56 +00:00
|
|
|
});
|
2021-10-01 04:59:04 +00:00
|
|
|
|
|
|
|
// Charges on an account
|
|
|
|
Route::get('charges/{o}',[AdminController::class,'charge_pending_account'])
|
|
|
|
->where('o','[0-9]+');
|
2018-07-31 04:11:00 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
// Our User Routes
|
2020-02-06 22:11:02 +00:00
|
|
|
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'])
|
2020-02-06 22:11:02 +00:00
|
|
|
->where('o','[0-9]+')
|
2019-07-04 04:55:05 +00:00
|
|
|
->middleware('can:view,o');
|
2021-07-13 02:31:56 +00:00
|
|
|
// Route::get('account/{o}/invoice','User\AccountController@view_invoice_next')
|
|
|
|
// ->where('o','[0-9]+')
|
|
|
|
// ->middleware('can:view,o');
|
2021-06-30 05:50:33 +00:00
|
|
|
Route::post('checkout/pay',[CheckoutController::class,'pay']);
|
2021-06-29 06:36:34 +00:00
|
|
|
Route::get('invoice/{o}',[HomeController::class,'invoice'])
|
2020-02-06 22:11:02 +00:00
|
|
|
->where('o','[0-9]+')
|
2019-07-04 04:55:05 +00:00
|
|
|
->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');
|
2021-06-30 05:50:33 +00:00
|
|
|
Route::get('invoice/cart',[CheckoutController::class,'cart_invoice']);
|
|
|
|
Route::get('invoice/cart/{o}',[CheckoutController::class,'cart_invoice'])
|
2020-02-06 22:11:02 +00:00
|
|
|
->where('o','[0-9]+')
|
2019-07-04 04:55:05 +00:00
|
|
|
->middleware('can:view,o');
|
2021-06-29 06:36:34 +00:00
|
|
|
Route::get('service/{o}',[HomeController::class,'service'])
|
2020-02-06 22:11:02 +00:00
|
|
|
->where('o','[0-9]+')
|
2019-07-04 04:55:05 +00:00
|
|
|
->middleware('can:view,o');
|
2021-09-29 04:57:25 +00:00
|
|
|
Route::match(['get','post'],'service/{o}/cancel-request',[ServiceController::class,'cancel_request'])
|
|
|
|
->where('o','[0-9]+')
|
2021-09-29 07:11:46 +00:00
|
|
|
->middleware('can:progress,o,"cancel-request"');
|
2021-09-29 04:57:25 +00:00
|
|
|
Route::match(['get','post'],'service/{o}/change-request',[ServiceController::class,'change_request'])
|
|
|
|
->where('o','[0-9]+')
|
2021-09-29 07:11:46 +00:00
|
|
|
->middleware('can:progress,o,"change-request"');
|
2021-09-29 04:57:25 +00:00
|
|
|
Route::get('service/{o}/change/{status}',[ServiceController::class,'change'])
|
2021-07-19 06:23:38 +00:00
|
|
|
->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() {
|
2021-09-29 07:36:55 +00:00
|
|
|
Route::get('invoice/{o}/email/{code}',[HomeController::class,'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)
|
2020-02-06 22:11:02 +00:00
|
|
|
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');
|
|
|
|
|
2021-07-02 04:35:43 +00:00
|
|
|
Route::get('search',[SearchController::class,'search']);
|
2019-06-21 06:21:48 +00:00
|
|
|
|
2021-06-30 05:50:33 +00:00
|
|
|
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');
|