15

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.

2
  • 9
    Cleared the config cache with php artisan config:clear? Commented Sep 15, 2015 at 12:57
  • @ Simon Svensson tnx. just got the answer before you mention it. Tnx Commented Sep 15, 2015 at 13:05

2 Answers 2

47

Seems like configuration settings were cached. use php artisan config:clear

Sign up to request clarification or add additional context in comments.

Comments

8

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.

1 Comment

I would have never considered that. That solved not only this problem, even with other configurations. Thank you so much!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.