donatas
3 years ago

Multiple .env files. Am I doing it right?

Posted 3 years ago by donatas

I'm planning a service with many Laravel websites under my control. I have each website specific .env files and I want one shared .env file so that I could easily update common variables without needing to update each website's .env.

I'm planning on adding this to the boostrap/app.php file of each website:

Dotenv::load(__DIR__.'/../../environments', '.env-main');

Which does exactly what I need, but I'm curious if that's good practice?

Please sign in or create an account to participate in this conversation.