Skip to content

Commit

Permalink
Reverting commit a86e268 in routing SP.
Browse files Browse the repository at this point in the history
This fixes #581
  • Loading branch information
nWidart committed Sep 5, 2018
1 parent b4b952d commit e50809d
Showing 1 changed file with 8 additions and 24 deletions.
32 changes: 8 additions & 24 deletions Modules/Core/Providers/RoutingServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,14 @@ public function map(Router $router)
$this->loadApiRoutes($router);
});

$prefixes = $this->getPrefixes();
foreach ($prefixes as $prefix) {
$router->group([
'namespace' => $this->namespace,
'prefix' => $prefix,
'middleware' => ['localizationRedirect', 'web'],
], function (Router $router) {
$this->loadBackendRoutes($router);
$this->loadFrontendRoutes($router);
});
}
}

/**
* Get locale prefixes
* @return array
*/
private function getPrefixes()
{
if (app('asgard.isInstalled')) {
return array_merge(json_decode(setting('core::locales')), ['']);
}

return [LaravelLocalization::setLocale()];
$router->group([
'namespace' => $this->namespace,
'prefix' => LaravelLocalization::setLocale(),
'middleware' => ['localizationRedirect', 'web'],
], function (Router $router) {
$this->loadBackendRoutes($router);
$this->loadFrontendRoutes($router);
});
}

/**
Expand Down

0 comments on commit e50809d

Please sign in to comment.