Dmitry Malys
Dmitry Malys

Reputation: 1323

Custom config value Laravel

I have a problem getting value from config/app.php in Laravel 5.5

I added a custom line:

'test' => '12345',

Then I try to get it in my controller like this:

 config(app.test);

and it returns nothing but when I try to get config(app.locale);

It returns en

What I'm doing wrong? Are there any commands that I have to run after editing the config file?

Upvotes: 0

Views: 1010

Answers (2)

Dmitry Malys
Dmitry Malys

Reputation: 1323

Finally, I found the command:

php artisan config:clear

Upvotes: 1

Tushar Waghmode
Tushar Waghmode

Reputation: 127

Try this,In laravel you can add custom value in config/constants.php eg:- "test" => "1234", you can access by this, Config::get('constants.test');

Upvotes: 0

Related Questions