in your config/app.php file there is this line:
'timezone' => env('TIMEZONE', 'UTC'),
to fetch the env value use: config('app.timezone')
also see this: https://laravel.com/docs/5.2/configuration#accessing-configuration-values
ITCan said:
in your config/app.php file there is this line:
'timezone' => env('TIMEZONE', 'UTC'),
to fetch the env value use: config('app.timezone')
also see this: https://laravel.com/docs/5.2/configuration#accessing-configuration-values
We can't use config for our environments. I have to use .env
This example is just 1 scenario where we are using .env for configurables and now and then any of them act-up.
lagbox said:
You dont use env outside of config files.
Well if .env uses DB connection info then I don't see the problem with using it for additional configurables? I have to use .env because we have dev-ops that deploy our code + I don't have access to the servers. The application is deployed to multiple servers which can point to other servers for connections and the dev-ops decide on which servers each version of the application connects to. From a security POV I don't know the server IP addresses and i'm not allowed to hard-code them in with switches in config. A load balancer handles connections. This is for a banking environment.
I simply don't understand why .env is not loading 100% of the time.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community