in laravel 5 , config/app.php I've set the locale to 'ar'
but while trying to get locale in code via:
config('app.locale');
I still get 'en'. Seems like config/app.php isn't auto-loaded/updated.
even if config/app.php is empty, executingconfig('app');
returns:
array:10 [▼
"debug" => true
"url" => "http://localhost"
"timezone" => "UTC"
"locale" => "en"
"fallback_locale" => "en"
"key" => "XXXXXXXXXXXXXXXXXXXXXXX" // changed here
"cipher" => "AES-256-CBC"
"log" => "single"
"providers" => array:31 [▶]
"aliases" => array:36 [▶]]
Some hint will be appreciated.
All of the configuration files for the Laravel framework are stored in the app/config directory. Each option in every file is documented, so feel free to look through the files and get familiar with the options available to you.
In a fresh Laravel installation, the root directory of your application will contain a .env.example file that defines many common environment variables.
Configuration. Laravel provides a unified API for various caching systems. The cache configuration is located at config/cache. php . In this file you may specify which cache driver you would like used by default throughout your application.
Seems like configuration settings were cached. use php artisan config:clear
Just a minor additional note to this. If you are running a local server on localhost:8000
with php artisan serve
and you make changes to either your .env
file or in config files, even after clearing the config cache with the steps in the accepted answer, it doesn't update.
You need to stop the local server (control + c in Terminal) and run php artisan serve
to start it again - then your changes get picked up.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With