You should be fine using that URL. How are you trying to view the value? env('API_URL') should be returning the value.
May 16, 2016
7
Level 2
Adding URLs to .env file
Hi all,
Is it possible to add urls to a .env file? In .env file, I have the following line:
API_URL=http://localhost/testsite/api.php
However, when I try to view the value of .env variable, it also comes back as null. So my question is, can we use url in the .env file?
Many thanks,
Emmanuel
Level 41
If you cached your configurations, you will need to clear it and then re-cache it.
php artisan config:clear
php artisan config:cache
1 like
Please or to participate in this conversation.