title: 'SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected' after returning from Laravel password reminder
body: <p>This is my home page route, where I get a random member:</p>
  
  <pre><code>Route::get('/', function()
  {
      $member = User::orderBy(DB::raw('RAND()'))-&gt;first();
      return View::make('landing', compact('member'));
  });
  </code></pre>
  
  <p>When the <code>RemindersController</code>'s <code>postRemind</code> method sends the email, I'm doing this:</p>
  
  <pre><code>case Password::REMINDER_SENT:
      return Redirect::to('/')-&gt;with('flash_message', 'Whatever message...');
  </code></pre>
  
  <p>And the home page returns:</p>
  
  <pre><code>Illuminate \ Database \ QueryException
  SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected (SQL: select * from `users` order by RAND() asc limit 1)
  </code></pre>
  
  <p>If I refresh the page right there, it fixes itself..
  I'm using <code>getenv()</code> and <code>.env.php</code> files to fill the database connection values. If I switch from that to hard code them in, it fixes the problem. And if I go back to using <code>getenv()</code> it works too. However, as soon as I restart WAMP, I'm back to square 1.</p>
  
  <p>What's going on?</p>