I understand how both environment and configuration variables work (and can work together).
What I'm unsure of is when it's OK to access an environment variable directly.
Here's an example: let's say I want to restrict my application to a single IP address which might be different between development and production environments, so in my
.env file I have:
In my middleware I can then check for the IP address using:
config\app.php I could create a variable like so:
'restricted_id' => env('RESTRICTED_IP', '')
Then in my middleware I would check for the IP using:
Is the addition of the variable in the configuraton file superflous and should I just access the enviroment variable directly?