diff --git a/docs/snippets/packages-routes-auto-locale.php b/docs/snippets/packages-routes-auto-locale.php new file mode 100644 index 0000000..185e0f8 --- /dev/null +++ b/docs/snippets/packages-routes-auto-locale.php @@ -0,0 +1,15 @@ + 'show', 'locale' => app()->getLocale()]); +// https://example.com/fr/foo/show + +route('localized.show', ['bar' => 'show', 'locale' => 'de']); +// https://example.com/de/foo/show + +route('localized.show', ['bar' => 'show']); +// https://example.com/fr/foo/show + +route('localized.show', ['bar' => 'show', 'locale' => 'de']); +// https://example.com/de/foo/show diff --git a/docs/topics/packages-routes.topic b/docs/topics/packages-routes.topic index 0c8cb85..56d8064 100644 --- a/docs/topics/packages-routes.topic +++ b/docs/topics/packages-routes.topic @@ -37,7 +37,7 @@ Usage information for the %repository-title-routes% package - +

Let's say an application has two localizations installed - French and German. @@ -530,6 +530,24 @@ of the %config-filename% file.

+ +

+ Since version 1.4, + when calling a localized route name, such as + route('localized.show', ['bar' => 'show']), + there is no need to specify the current localization code. +

+ + + + + + + + + +
+