Skip to content
This repository has been archived by the owner on Mar 27, 2022. It is now read-only.

Commit

Permalink
Added route prefix in config and route mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
adifaidz committed Mar 7, 2017
1 parent 5fe0024 commit af0c3d8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
18 changes: 16 additions & 2 deletions config/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,28 @@

/*
|--------------------------------------------------------------------------
| Admin route file
| Prefix for all admin routes in admin file
|--------------------------------------------------------------------------
*/
'admin_route_prefix' => 'admin',

/*
|--------------------------------------------------------------------------
| Admin route file path
|--------------------------------------------------------------------------
*/
'admin_route' => base_path('routes/admin.php'),

/*
|--------------------------------------------------------------------------
| Client route file
| Prefix for all admin routes in admin file
|--------------------------------------------------------------------------
*/
'client_route_prefix' => '',

/*
|--------------------------------------------------------------------------
| Client route file path
|--------------------------------------------------------------------------
*/
'client_route' => base_path('routes/client.php'),
Expand Down
2 changes: 2 additions & 0 deletions src/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ public static function routes($callback = null, array $options = [])
public static function mapBaseRoutes(){
Route::middleware(['web','client'])
->namespace("App\Http\Controllers")
->prefix(config('base.client_route_prefix'))
->group(config('base.client_route'));

Route::middleware(['web','admin'])
->namespace("App\Http\Controllers")
->prefix(config('base.admin_route_prefix'))
->group(config('base.admin_route'));
}
}

0 comments on commit af0c3d8

Please sign in to comment.