Support the ongoing development of Laravel.io →
Configuration Architecture
Last updated 2 years ago.
0

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

Last updated 8 years ago.
0

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.

0

You dont use env outside of config files.

0

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.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Wancieho wancieho Joined 17 Apr 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.