title: How to load multiple .env files or load .env from parent directory in Laravel 6
body: <p>For a Laravel app using docker-compose I have the following (simplified) folder structure:</p>
  
  <pre><code>Project
  |
  |-- data
      |-- ...
  |-- docker
      |-- ...
  |-- laravel
      |-- app
      |-- ...
      |-- .env
  |-- docker-compose.yml
  |-- .env
  </code></pre>
  
  <p>Docker-compose is set up to load database connection details from the <code>.env</code> file in the root folder of the project when constructing the containers. Laravel also needs these and I have to duplicate them in the <code>.env</code> file inside the laravel folder.</p>
  
  <p>I would like to avoid this duplication. Ideally I would load both .env files in Laravel to avoid cluttering up the docker-compose .env with stuff that is only relevant to Laravel. But I would be almost as happy to just have the one .env file in the project root, provided there is a clean way to do it. </p>
  
  <p>I have found no configuration setting but relevant methods <code>loadEnvironmentFrom()</code> and <code>useEnvironmentPath()</code> inside the <code>Illuminate\Foundation\Application</code> but I'm not sure where to call them from. I would extend Application, but it seems that Dotenv is already loaded by the time it is instantiated in <code>/boostrap/app.php</code></p>
  
  <p>Hopefully there is somewhere outside of the vendor dolder where I could change the path or load a different .env file in time for it to be used by the configuration files. Help is greatly appreciated</p>