4 ms·
> - .env file - just use PHP files for configs which opens many possibilities like inheritable config setups. Instead of just dev or staging or prod you would i
by fendy3002 5y ago
> - .env file - just use PHP files for configs which opens many possibilities like inheritable config setups. Instead of just dev or staging or prod you would instead have main, dev, production where main is env variables that don't change between environments.
Uh what, .env is standard practices for many languages even in docker. And Laravel doesn't prohibit you to extend the config folder with your custom settings. You can easily do both.
And for anyone who don't know yet, don't commit your configuration to the repo.
- hparadiz 5y agoThat's actually kind of why I don't like it. Combining a Laravel project with docker makes you end up with multiple env files and it gets a little confusing.
- fendy3002 5y agoYou're getting it wrong. PHP's (and Laravel) getenv is getting the system's environment variable. .env is a helper that overrides them. It just helping you setup different env var for each project in same system. If you're using docker, it's fine to just use docker's env_file or environment value, or use Laravel's .env only if you prefer it.