Skip to content

Commit

Permalink
Add dashboard_path and home_controller to config
Browse files Browse the repository at this point in the history
  • Loading branch information
freescout-help-desk committed Jan 5, 2022
1 parent ac03db6 commit 11b79b2
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 6 deletions.
16 changes: 16 additions & 0 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,22 @@
*/
'user_permissions' => env('APP_USER_PERMISSIONS', ''),

/*
|--------------------------------------------------------------------------
| Dashboard path.
|
|-------------------------------------------------------------------------
*/
'dashboard_path' => env('APP_DASHBOARD_PATH', ''),

/*
|--------------------------------------------------------------------------
| Home page controller.
|
|-------------------------------------------------------------------------
*/
'home_controller' => env('APP_HOMEPAGE_CONTROLLER', 'SecureController@dashboard'),

/*
|--------------------------------------------------------------------------
| Disable update checker
Expand Down
2 changes: 1 addition & 1 deletion resources/views/errors/403.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

@section('message')
{{ __('Access denied') }}
<br/><br/><small>{{ __('Go to') }} <a href="{{ url('/') }}">{{ __('Homepage') }}</a></small>
<br/><br/><small>{{ __('Go to') }} <a href="{{ route('dashboard') }}">{{ __('Homepage') }}</a></small>
@endsection
2 changes: 1 addition & 1 deletion resources/views/errors/404.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

@section('message')
{{ __('Sorry, the page you are looking for could not be found.') }}
<br/><br/><small>{{ __('Go to') }} <a href="{{ url('/') }}">{{ __('Homepage') }}</a></small>
<br/><br/><small>{{ __('Go to') }} <a href="{{ route('dashboard') }}">{{ __('Homepage') }}</a></small>
@endsection
2 changes: 1 addition & 1 deletion resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<i class="glyphicon glyphicon-arrow-left"></i>
</a>
@else
<a class="navbar-brand" href="{{ url('/') }}" title="{{ __('Dashboard') }}">
<a class="navbar-brand" href="{{ route('dashboard') }}" title="{{ __('Dashboard') }}">
<img src="@filter('layout.header_logo', asset('img/logo-brand.svg'))" height="100%" alt="" />
{{-- config('app.name', 'FreeScout') --}}
</a>
Expand Down
9 changes: 6 additions & 3 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,19 @@

Auth::routes();

// Redirects
Route::redirect('/home', '/', 301);
// Authentication redirects to /home
Route::redirect('/home', '/'.config('app.dashboard_path'), 301);

// Public routes
Route::get('/user-setup/{hash}', 'PublicController@userSetup')->name('user_setup');
Route::post('/user-setup/{hash}', 'PublicController@userSetupSave');
Route::get('/storage/attachment/{dir_1}/{dir_2}/{dir_3}/{file_name}', 'PublicController@downloadAttachment')->name('attachment.download');

// General routes for logged in users
Route::get('/', 'SecureController@dashboard')->name('dashboard');
if (config('app.dashboard_path')) {
Route::get('/', config('app.home_controller'));
}
Route::get('/'.config('app.dashboard_path'), 'SecureController@dashboard')->name('dashboard');
Route::get('/app-logs/app', ['uses' => '\Rap2hpoutre\LaravelLogViewer\LogViewerController@index', 'middleware' => ['auth', 'roles'], 'roles' => ['admin']])->name('logs.app');
Route::get('/app-logs/{name?}', ['uses' => 'SecureController@logs', 'middleware' => ['auth', 'roles'], 'roles' => ['admin']])->name('logs');
Route::post('/app-logs/{name?}', ['uses' => 'SecureController@logsSubmit', 'middleware' => ['auth', 'roles'], 'roles' => ['admin']])->name('logs.action');
Expand Down

0 comments on commit 11b79b2

Please sign in to comment.