162 lines
6.7 KiB
PHP
162 lines
6.7 KiB
PHP
<?php
|
|
|
|
use Leenooks\Controllers\AdminController as LeenooksAdminController;
|
|
use App\Http\Controllers\{AdminController,
|
|
Auth\LoginController,
|
|
Auth\SocialLoginController,
|
|
CostController,
|
|
CheckoutController,
|
|
HomeController,
|
|
MediaController,
|
|
OrderController,
|
|
PaypalController,
|
|
ProductController,
|
|
SearchController,
|
|
ServiceController,
|
|
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',[LoginController::class,'logout']);
|
|
|
|
// Account linking to OPENID host
|
|
Route::group(['middleware'=>['theme:adminlte-be']],function() {
|
|
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']);
|
|
});
|
|
|
|
// 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');
|
|
|
|
// Our Admin Routes - for wholesalers
|
|
Route::group(['middleware'=>['theme:adminlte-be','auth','role:wholesaler'],'prefix'=>'a'],function() {
|
|
// Site Setup
|
|
Route::match(['get','post'],'setup',[AdminController::class,'setup']);
|
|
// Product Setup
|
|
Route::match(['get'],'product',[ProductController::class,'home']);
|
|
Route::match(['get','post'],'product/details/{o?}',[ProductController::class,'details']);
|
|
// Supplier Setup
|
|
// @todo Move to Supplier Controller
|
|
Route::match(['get'],'supplier',[AdminController::class,'supplier']);
|
|
Route::match(['get','post'],'supplier/details/{o?}',[AdminController::class,'supplier_addedit']);
|
|
|
|
// Route::get('service/{o}','AdminHomeController@service');
|
|
// Route::post('service/{o}','AdminHomeController@service_update');
|
|
// Route::get('report/products','Wholesale\ReportController@products');
|
|
|
|
// Charges
|
|
Route::match(['get','post'],'charge/addedit/{o?}',[AdminController::class,'charge_addedit']);
|
|
Route::get('charge/unprocessed',[AdminController::class,'charge_unprocessed']);
|
|
|
|
// Payments
|
|
Route::match(['get','post'],'payment/addedit/{o?}',[AdminController::class,'pay_addedit']);
|
|
Route::get('payment/unapplied',[AdminController::class,'pay_unapplied']);
|
|
|
|
Route::post('service/edit/{o}',[ServiceController::class,'update'])
|
|
->where('o','[0-9]+')
|
|
->middleware('can:update,o');
|
|
//Route::get('accounting/connect','AccountingController@connect');
|
|
|
|
Route::get('cost/{o}',[CostController::class,'home'])
|
|
->where('o','[0-9]+')
|
|
->middleware('can:view,o');
|
|
});
|
|
|
|
Route::get('admin/switch/stop',[LeenooksAdminController::class,'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}',[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']);
|
|
Route::get('email',[ServiceController::class,'email_list']);
|
|
Route::get('hosting',[ServiceController::class,'hosting_list']);
|
|
});
|
|
|
|
// Charges on an account
|
|
Route::get('charges/{o}',[AdminController::class,'charge_pending_account'])
|
|
->where('o','[0-9]+');
|
|
|
|
// Reseller API calls
|
|
Route::post('service_change_charges/{o}',[ServiceController::class,'service_change_charges_display'])
|
|
->where('o','[0-9]+');
|
|
});
|
|
|
|
// Our User Routes
|
|
Route::group(['middleware'=>['theme:adminlte-be','auth'],'prefix'=>'u'],function() {
|
|
Route::get('home',[HomeController::class,'home']);
|
|
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']);
|
|
Route::get('invoice/{o}',[HomeController::class,'invoice'])
|
|
->where('o','[0-9]+')
|
|
->middleware('can:view,o');
|
|
Route::get('invoice/{o}/pdf',[HomeController::class,'invoice_pdf'])
|
|
->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');
|
|
Route::get('service/{o}',[HomeController::class,'service'])
|
|
->where('o','[0-9]+')
|
|
->middleware('can:view,o');
|
|
Route::match(['get','post'],'service/{o}/cancel-request',[ServiceController::class,'cancel_request'])
|
|
->where('o','[0-9]+')
|
|
->middleware('can:progress,o,"cancel-request"');
|
|
Route::match(['get','post'],'service/{o}/change-request',[ServiceController::class,'change_request'])
|
|
->where('o','[0-9]+')
|
|
->middleware('can:progress,o,"change-request"');
|
|
// @todo This shouldnt be a user privilege.
|
|
Route::match(['get','post'],'service/{o}/change-pending',[ServiceController::class,'change_pending'])
|
|
->where('o','[0-9]+')
|
|
->middleware('can:progress,o,"change-pending"');
|
|
Route::get('service/{o}/change/{status}',[ServiceController::class,'change'])
|
|
->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}',[HomeController::class,'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::class,'index']);
|
|
Route::post('order',[OrderController::class,'submit']);
|
|
});
|
|
|
|
Route::get('product_order/{o}',[OrderController::class,'product_order']);
|
|
Route::get('product_info/{o}',[OrderController::class,'product_info']);
|
|
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']);
|