Skip to content

Commit

Permalink
panichd route: improve availability and redirections from pages
Browse files Browse the repository at this point in the history
  • Loading branch information
xaviqv committed Jan 12, 2018
1 parent 0740c3c commit 8c58dd9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/Controllers/InstallController.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public function index()
'options' => [
'<a href="'.route(Setting::grab('admin_route').'.category.index').'">'.trans('panichd::install.package-link-categories').'</a>',
'<a href="'.route(Setting::grab('main_route').'.index').'">'.trans('panichd::install.package-link-new-ticket').'</a>',

]
]);
}else{
Expand Down
19 changes: 12 additions & 7 deletions src/PanicHDServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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');
});
}
}
Expand Down

0 comments on commit 8c58dd9

Please sign in to comment.