Published 5 days ago by boynet
for example in config/app.php
the time zone used like
'timezone' => 'UTC'
so If I want to change this value inside .env I need to edit the config files directly, why not all options are there by default? it make me think that maybe I should not change those?
I don't see any reason why you couldn't add the timezone to your .env if you wanted to. Just make sure you update your config/app.php
'timezone' => env('ENV_TIMEZONE', 'UTC'),
If I had to guess as to why it might not be there by default; .env files are not committed to your repo.
If the timezone is set on your local machine in .env and left as a default in your config/app.php, you might be developing with your app configured for one timezone and the production code configured for another.
This can negatively effect your application including logging and reporting especially if your logs are pulled to a central location.
For non secret things that you want to stay consistent across all developers machines you might just consider leaving them hard coded in config/app.php
@boynet Are you asking why all config options are not .env variables? I suppose you can make whatever you want an environment variable.
'timezone' => env('MYTIMEZONE', 'UTC')
...and then add to .env file:
MYTIMEZONE=UTC (or whatever you want it to be)
If this does what you want, make sure to place any environment variables you create into
.env.example so you're tracking them.