File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ public static function register()
2424 $ omitPrefix = Config::get ('localized-routes.omit_url_prefix_for_locale ' );
2525
2626 foreach ($ locales as $ locale => $ domain ) {
27+ // Allow supported locales to be a
28+ // simple array of locales or an
29+ // array of ['locale' => 'domain']
2730 if (is_numeric ($ locale )) {
2831 $ locale = $ domain ;
2932 $ domain = null ;
@@ -38,16 +41,18 @@ public static function register()
3841 // the locale to the route name.
3942 $ route = Route::name ("{$ locale }. " );
4043
44+ // Add a custom domain route group
45+ // if a domain is configured.
46+ if ($ domain !== null ) {
47+ $ route ->domain ($ domain );
48+ }
49+
4150 // Prefix the URL unless the locale
4251 // is configured to be omitted.
4352 if ($ domain === null && $ locale !== $ omitPrefix ) {
4453 $ route ->prefix ($ locale );
4554 }
4655
47- if ($ domain !== null ) {
48- $ route ->domain ($ domain );
49- }
50-
5156 $ route ->group ($ callback );
5257 }
5358
You can’t perform that action at this time.
0 commit comments