From 8c58dd94b1570a8c7cfecebc0684c0abe2e59e3a Mon Sep 17 00:00:00 2001 From: XaviQV Date: Fri, 12 Jan 2018 23:11:00 +0100 Subject: [PATCH] panichd route: improve availability and redirections from pages --- src/Controllers/InstallController.php | 1 - src/PanicHDServiceProvider.php | 19 ++++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/Controllers/InstallController.php b/src/Controllers/InstallController.php index ed8493e8..0baff5e9 100644 --- a/src/Controllers/InstallController.php +++ b/src/Controllers/InstallController.php @@ -39,7 +39,6 @@ public function index() 'options' => [ ''.trans('panichd::install.package-link-categories').'', ''.trans('panichd::install.package-link-new-ticket').'', - ] ]); }else{ diff --git a/src/PanicHDServiceProvider.php b/src/PanicHDServiceProvider.php index 2c00e674..0cca8b70 100644 --- a/src/PanicHDServiceProvider.php +++ b/src/PanicHDServiceProvider.php @@ -36,14 +36,13 @@ public function boot() $this->loadTranslationsFrom(__DIR__.'/Translations', 'panichd'); $this->loadViewsFrom(__DIR__.'/Views', 'panichd'); - if (Request::is('panichd') || Request::is('panichd/*') - || in_array(Request::path(), ['tickets', 'tickets-admin'])){ - $authMiddleware = Helpers\LaravelVersion::authMiddleware(); + $authMiddleware = Helpers\LaravelVersion::authMiddleware(); - Route::get('panichd', 'PanicHD\PanicHD\Controllers\InstallController@index') - ->middleware($authMiddleware) - ->name("panichd.install.index"); - + Route::get('panichd', 'PanicHD\PanicHD\Controllers\InstallController@index') + ->middleware($authMiddleware) + ->name("panichd.install.index"); + + if (Request::is('panichd') || Request::is('panichd/*')){ Route::post('/panichd/install', [ 'middleware' => $authMiddleware, 'as' => 'panichd.install.setup', @@ -249,9 +248,15 @@ public function boot() } else{ Route::get('/tickets', function () { return redirect()->route('panichd.install.index'); + }); + Route::get('/tickets/{menu}', function () { + return redirect()->route('panichd.install.index'); }); Route::get('/tickets-admin', function () { return redirect()->route('panichd.install.index'); + }); + Route::get('/tickets-admin/{menu}', function () { + return redirect()->route('panichd.install.index'); }); } }