Skip to content

Commit ffcca49

Browse files
committed
public routes
1 parent 3aaac44 commit ffcca49

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/Providers/RouteServiceProvider.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,13 @@ public function map(Router $router)
4242
/**
4343
* Front office routes
4444
*/
45-
$routes = app('TypiCMS.routes');
45+
$routes = $this->app->make('TypiCMS.routes');
4646
foreach (Config::get('translatable.locales') as $lang) {
4747
if (isset($routes['places'][$lang])) {
4848
$uri = $routes['places'][$lang];
49-
} else {
50-
$uri = 'places';
51-
if (Config::get('app.fallback_locale') != $lang || config('typicms.main_locale_in_url')) {
52-
$uri = $lang . '/' . $uri;
53-
}
49+
$router->get($uri, array('as' => $lang.'.places', 'uses' => 'PublicController@index'));
50+
$router->get($uri.'/{slug}', array('as' => $lang.'.places.slug', 'uses' => 'PublicController@show'));
5451
}
55-
$router->get($uri, array('as' => $lang.'.places', 'uses' => 'PublicController@index'));
56-
$router->get($uri.'/{slug}', array('as' => $lang.'.places.slug', 'uses' => 'PublicController@show'));
5752
}
5853

5954
/**

0 commit comments

Comments
 (0)