You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inside this closure you can use Route Groups such as Middlewares, Namespaces or even Sub-Domain Routing. This closure will prepend the locale to the route's URI and name.
@@ -86,13 +86,13 @@ This will be the result of the viewed configuration examples.
86
86
> Beware that you don't register the same URL twice when omitting the locale. You can't have a localized /about route and also register a non-localized /about route in this case. The same idea applies to the / (root) route! Also note that the route names still have the locale prefix.
87
87
88
88
## Generate Localized URLs
89
-
You should use the ``trans_route`` helper in order to get the requested route localized. To this helper you can pass a route name or a route url, in booth cases it will be localized.
89
+
You should use the `trans_route` helper in order to get the requested route localized. To this helper you can pass a route name or a route url, in booth cases it will be localized.
If your building a dropdown or similar with links to change the locale of the application, you should use the ``switch_to_locale`` helper.
124
+
If you're building a dropdown or similar with links to change the locale of the application, you should use the `switch_to_locale` helper.
125
125
```php
126
126
switch_to_locale('en') // Changes to 'en' locale without changing the route
127
127
```
@@ -132,12 +132,14 @@ switch_to_locale('en') // Changes to 'en' locale without changing the route
132
132
You can to customize the name of the translations tables.
133
133
134
134
```php
135
-
"table_sufix" => "_translations"
135
+
'table_suffix' => '_translations'
136
136
```
137
137
138
-
The usage of this value will be the following one. If you have the model ``Page`` with the trait ``HasTranslations`` and the model table is ``pages``. This package will lookup for the translations at the table ``page_translations``. Always the model table followed by the table suffix in the config file.
138
+
The usage of this value will be the following one. If you have the model `Page` with the trait `HasTranslations` and the model table is `pages`.
139
+
This package will look up for the translations at the table `page_translations`. Always the model table followed by the table suffix in the config file.
139
140
140
-
The translations tables should contain the translatable fields from the model, the id, a column ``locale`` to specify the language saved, ``created_at`` and ``updated_at``. The column ``deleted_at`` should **never** be in the translations table, regardless the models is ``softDeleted`` or not.
141
+
The translations tables should contain the translatable fields from the model, the id, a column `locale` to specify the language saved, `created_at` and `updated_at`.
142
+
The column `deleted_at` should **never** be in the translations table, regardless the models is `softDeleted` or not.
0 commit comments