Reputation: 1600
I have updated application to Laravel latest version 5.8 and after update the getenv() function which returns env file variable value is returning false.
However when i used env() I am able to get the env variable value.
I have followed the official documentation and nothing is there which suggest to change from getenv() to env().
https://laravel.com/docs/5.8/configuration
Here suggesting to change to env from getenv()
Please suggest if i need to change every reference of getenv to env or there is another way out.
Upvotes: 0
Views: 3167
Reputation: 61
Try clearing your cache php artisan config:clear
, php artisan cache:clear
Upvotes: 0
Reputation: 1945
There was specific version of laravel (5.8.4) where getenv was returning false, this has been updated in 5.8.5 or above.
Upvotes: 0
Reputation: 31
The correct way to do it is by changing from getenv
to env
. Also, getenv
doesn't have a second parameter to set a default value.
Upvotes: 2