title: How to use multiple DB connections using .env in Lumen 5.5..?
body: <p>I have installed Lumen 5.5 and configured .env :</p>
  <pre><code>APP_ENV=local
  APP_DEBUG=true
  APP_KEY=2gh4RD89kWa87clEs6Vhjso3XhsFo3dR
  APP_TIMEZONE=UTC
  
  DB_CONNECTION=mysql
  DB_HOST=127.0.0.1
  DB_PORT=3306
  DB_DATABASE=XXXXXX
  DB_USERNAME=XXXXXX
  DB_PASSWORD=XXXXXX
  
  CACHE_DRIVER=memcached
  QUEUE_DRIVER=sync
  </code></pre>
  <p>and created a model using Eloquent :</p>
  <pre><code>namespace App\Models;
  
  use Illuminate\Database\Eloquent\Model;
  
  class Test extends Model {
      
      public $timestamps = false;
      protected $connection = 'foo';
  }
  </code></pre>
  <p>Now there is no documention on the official site to configure multiple DB connection in <code>.env</code> file. My single connection is working perfectly fine but now I need to add another DB connection details.</p>
  <p>What I have tried so far :</p>
  <ol>
  <li><p>Created db config file as <code>app/config/database.php</code> with multiple db details but my setup doesn't get affected whatever i write in that file. It's only using <code>.env</code> to get connection details.</p>
  </li>
  <li><p>Tried to add multiple DB connection details in <code>.env</code> file like :</p>
  <p>DB_CONNECTION=mysql
  DB_HOST=127.0.0.1
  DB_PORT=3306
  DB_DATABASE=XXXXXX
  DB_USERNAME=XXXXXX
  DB_PASSWORD=XXXXXX</p>
  <p>FOO_DB_CONNECTION=mysql
  FOO_DB_HOST=127.0.0.1
  FOO_DB_PORT=3306
  FOO_DB_DATABASE=FOOXXXXXX
  FOO_DB_USERNAME=FOOXXXXXX
  FOO_DB_PASSWORD=FOOXXXXXX</p>
  <p>DB_CONNECTION_FOO=mysql
  DB_HOST_FOO=127.0.0.1
  DB_PORT_FOO=3306
  DB_DATABASE_FOO=FOOXXXXXX
  DB_USERNAME_FOO=FOOXXXXXX
  DB_PASSWORD_FOO=FOOXXXXXX</p>
  </li>
  </ol>
  <p>But it just keep giving me this error :</p>
  <pre><code>(1/1) InvalidArgumentException
  Database [foo] not configured.
  </code></pre>
  <p>I have tried everything I found on Google.</p>