Reverting commit a86e2688 in routing SP.

This fixes #581
parent b4b952dc
...@@ -52,30 +52,14 @@ abstract class RoutingServiceProvider extends ServiceProvider ...@@ -52,30 +52,14 @@ abstract class RoutingServiceProvider extends ServiceProvider
$this->loadApiRoutes($router); $this->loadApiRoutes($router);
}); });
$prefixes = $this->getPrefixes(); $router->group([
foreach ($prefixes as $prefix) { 'namespace' => $this->namespace,
$router->group([ 'prefix' => LaravelLocalization::setLocale(),
'namespace' => $this->namespace, 'middleware' => ['localizationRedirect', 'web'],
'prefix' => $prefix, ], function (Router $router) {
'middleware' => ['localizationRedirect', 'web'], $this->loadBackendRoutes($router);
], function (Router $router) { $this->loadFrontendRoutes($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()];
} }
/** /**
......
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