Getting a variable is pretty straightforward, and it works fine (Config::get('app.key')) but when I try to create a custom variable in .env, like app.whatever it brings up nothing.
What I've tried:
Changing the value of a standard Laravel var, like app.key - works fine. So, cache is not the issue, but...
I did try clearing the cache with php artisan cache:clear - no bueno.
print_r($_ENV) shows app.whatever in the array, so it's there.
Thinking maybe 'app' is reserved, I tried to name the variable simply whatever - still not able to get it.
Should I just be using $_ENV['APP_WHATEVER']? That feels...dirty. And that's okay, I can do dirty, but I try to keep it out of my code if at all possible ;) I'm still pretty new and I think I've Googled everything I can think of and checked the docs, but I may be missing something simple.
@redcore are you trying to access values from .env using $_ENV? that's not how it works. Use env() helper function or better - use .env only to set values in config, this way they will be cached when you run php artisan config:cache in production environment and you will avoid some performance loss there.
I just went through the same situation but in case I left the variable as APP_FRONT_URL in the .env file and in the config/app.php folder I added a new index in the array returning the environment variable: