$config->set not working?

Posted 3 years ago by SergioGregorutti

Hi all,

I'm using the Config facade to set and use global variables on my site and it's working fine, but I have a problem.

On the AppServiceProvider.php (boot method) Im doing this:

$config->set('world.name', 'Mundo Hurlingham');

And then on a controller Im trying to overwrite the value doing this:

$config->set('world.name', 'Test');
echo "Result: ".config('world.name').'.';

But the problem is that the config('world.name') result is always "Mundo Hurlingham". And then I use the value on a view an is still the old value.

How can I overwrite the value? Is there a way to do this? Maybe clearing the cache or something like that?

Thanks in advance!

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.