I have configured locale in config/app.php as the following:
'locale' => env('APP_LOCALE', 'hu'),
'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'),
'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'),
Now when I write out the locale in the view I got "en".
{{App::currentLocale()}}
Why isn't this configuration option working?
Laravel's default .env file contains some common configuration values that may differ based on whether your application is running locally or on a production web server. These values are then read by the configuration files within the config directory using Laravel's env function.
It is often helpful to have different configuration values based on the environment where the application is running. For example, you may wish to use a different cache driver locally than you do on your production server.
If you want to set a default configuration that remains consistent across all environments, you can add it to the app.php
file and remove the APP_LOCALE
entry from the .env
file. This way, you won't need to specify it in two different places.