File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -31,13 +31,15 @@ public function map()
3131 * Front office routes
3232 */
3333 if ($ page = TypiCMS::getPageLinkedToModule ('places ' )) {
34- $ options = $ page ->private ? ['middleware ' => 'auth ' ] : [];
35- foreach (locales () as $ lang ) {
36- if ($ page ->translate ('status ' , $ lang ) && $ uri = $ page ->uri ($ lang )) {
37- $ router ->get ($ uri , $ options + ['uses ' => 'PublicController@index ' ])->name ($ lang .'::index-places ' );
38- $ router ->get ($ uri .'/{slug} ' , $ options + ['uses ' => 'PublicController@show ' ])->name ($ lang .'::place ' );
34+ $ router ->middleware ('public ' )->group (function (Router $ router ) use ($ page ) {
35+ $ options = $ page ->private ? ['middleware ' => 'auth ' ] : [];
36+ foreach (locales () as $ lang ) {
37+ if ($ page ->translate ('status ' , $ lang ) && $ uri = $ page ->uri ($ lang )) {
38+ $ router ->get ($ uri , $ options + ['uses ' => 'PublicController@index ' ])->name ($ lang .'::index-places ' );
39+ $ router ->get ($ uri .'/{slug} ' , $ options + ['uses ' => 'PublicController@show ' ])->name ($ lang .'::place ' );
40+ }
3941 }
40- }
42+ });
4143 }
4244
4345 /*
You can’t perform that action at this time.
0 commit comments