Commit e47e7a0d authored by Pralhad Shrestha's avatar Pralhad Shrestha Committed by Nicolas Widart

Updated the routes to be overrided if required else the normal way works (#240)

parent 12ae3de2
...@@ -4,6 +4,7 @@ namespace App\Providers; ...@@ -4,6 +4,7 @@ namespace App\Providers;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Mcamara\LaravelLocalization\Facades\LaravelLocalization;
class RouteServiceProvider extends ServiceProvider class RouteServiceProvider extends ServiceProvider
{ {
...@@ -23,6 +24,9 @@ class RouteServiceProvider extends ServiceProvider ...@@ -23,6 +24,9 @@ class RouteServiceProvider extends ServiceProvider
public function boot() public function boot()
{ {
parent::boot(); parent::boot();
$this->app->booted(function () {
$this->map();
});
} }
/** /**
* Define the routes for the application. * Define the routes for the application.
...@@ -44,8 +48,9 @@ class RouteServiceProvider extends ServiceProvider ...@@ -44,8 +48,9 @@ class RouteServiceProvider extends ServiceProvider
protected function mapWebRoutes() protected function mapWebRoutes()
{ {
Route::group([ Route::group([
'middleware' => 'web', 'middleware' => ['localizationRedirect', 'web'],
'namespace' => $this->namespace, 'namespace' => $this->namespace,
'prefix' => LaravelLocalization::setLocale(),
], function ($router) { ], function ($router) {
require base_path('routes/web.php'); require base_path('routes/web.php');
}); });
......
...@@ -175,9 +175,10 @@ return [ ...@@ -175,9 +175,10 @@ return [
App\Providers\AppServiceProvider::class, App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class, App\Providers\AuthServiceProvider::class,
App\Providers\EventServiceProvider::class, App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
Modules\Core\Providers\AsgardServiceProvider::class, Modules\Core\Providers\AsgardServiceProvider::class,
App\Providers\RouteServiceProvider::class,
], ],
/* /*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment