chinleung / laravel-multilingual-routes

A package to handle multilingual routes in your Laravel application.
https://github.com/chinleung/laravel-multilingual-routes-demo
MIT License
401 stars 25 forks source link

Locale is a protected property #6

Closed ghost closed 5 years ago

ghost commented 5 years ago

$request->locale is a protected property and will always return null. Changed it to the appropriate getter.

chinleung commented 5 years ago

@ef2-delanoderooij The $request->locale was intended to update the application locale based on a $_REQUEST['locale']. Therefore, the null is intended unless there's a locale provided in the arguments of the route.

For example:

https://locales.test?locale=fr

However, if changed to $request->getLocale(), it will not retrieve the expected value.