File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ route ('localized.show ' , ['bar ' => 'show ' , 'locale ' => app ()->getLocale ()]);
6
+ // https://example.com/fr/foo/show
7
+
8
+ route ('localized.show ' , ['bar ' => 'show ' , 'locale ' => 'de ' ]);
9
+ // https://example.com/de/foo/show
10
+
11
+ route ('localized.show ' , ['bar ' => 'show ' ]);
12
+ // https://example.com/fr/foo/show
13
+
14
+ route ('localized.show ' , ['bar ' => 'show ' , 'locale ' => 'de ' ]);
15
+ // https://example.com/de/foo/show
Original file line number Diff line number Diff line change 37
37
<chapter title =" Usage" id =" usage" >
38
38
<link-summary >Usage information for the %repository-title-routes% package</link-summary >
39
39
40
- <include from =" library-models.topic" element-id =" video-usage" />
40
+ <include from =" library-models.topic" element-id =" video-usage" />
41
41
42
42
<p >
43
43
Let's say an application has two localizations installed - French and German.
530
530
of the <code >%config-filename%</code > file.
531
531
</p >
532
532
533
+ <note >
534
+ <p >
535
+ Since version <a href =" https://github.com/Laravel-Lang/routes/releases/tag/1.4.0" >1.4</a >,
536
+ when calling a localized route name, such as
537
+ <code >route('localized.show', ['bar' => 'show'])</code >,
538
+ there is no need to specify the current localization code.
539
+ </p >
540
+
541
+ <tabs >
542
+ <tab title =" After" >
543
+ <code-block lang =" php" src =" packages-routes-auto-locale.php" include-lines =" 11-15" />
544
+ </tab >
545
+ <tab title =" Before" >
546
+ <code-block lang =" php" src =" packages-routes-auto-locale.php" include-lines =" 5-9" />
547
+ </tab >
548
+ </tabs >
549
+ </note >
550
+
533
551
<chapter title =" Examples" id =" via_localization_group_examples" >
534
552
<tabs >
535
553
<tab title =" Default locale" >
You can’t perform that action at this time.
0 commit comments