phplaravelconfiglaravel-5.4

Can't read new config variables in laravel 5.4


I added a new config variable to the config/app.php file in laravel like this

'foo' => 'pass'

but when I tried reading it using config('app.foo') I keep getting null while other variables return correct values. What do I need to do?


Solution

  • Syntax you're using is correct, try to clear configuration cache by using this command:

    php artisan config:clear