priyono priyono - 7 months ago 29
PHP Question

Laravel 5.1 returns wrong config value

I have a custom Laravel config file called config/alfresco.php. The file is a special file to keep Alfresco config connection. Here is what it is look like:

<?php
/*
|--------------------------------------------------------------------------
| CMIS BROWSER URL
|--------------------------------------------------------------------------
|
| The address of Alfresco server
|
*/
// http://<another IP>:9080/alfresco/api/-default-/public/cmis/versions/1.1/browser
'CMIS_BROWSER_URL' => 'http://192.168.1.5:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser',

/*
|--------------------------------------------------------------------------
| CMIS BROWSER USER
|--------------------------------------------------------------------------
|
| Alfresco username credential
|
*/

'CMIS_BROWSER_USER' => 'admin',


I tried to get the config's value by calling the following:

Config::get('alfresco.CMIS_BROWSER_URL');


However, it seems always to return wrong value. In my case, it is:

http://<another IP>:9080/alfresco/api/-default-/public/cmis/versions/1.1/browser


Note that the value that is called is the one that is commented. I tried to get rid of it, but it still comes with the same result. I am sure that the value is only appear on this config.

My another attempt is to do:

php artisan cache:clear


And it came with no luck.
Thanks in advance :)




Solution:

Thanks to @James for pointing out the solution, it is:

php artisan config:clear


I am sure it was a cache on Laravel configuration. Hope this help for others :)

Answer

As you have changed some values in your config files, you should make sure you have cleared any cached versions of these - otherwise they won't reflect the latest changes.

To do this, just run php artisan config:clear.