title: Laravel 5.1 - Checking a Database Connection
body: <p>I am trying to check if a database is connected in Laravel.</p>
  
  <p>I've looked around the documentation and can't find anything. The closest thing I've found is <a href="http://laravel.com/docs/5.1/database#accessing-connections" rel="noreferrer">this</a>, but this doesn't solve my problem.</p>
  
  <p>I have three instances of MySQL that are set up on different machines. Below is a simplified version of what I am trying to achieve.</p>
  
  <ol>
  <li>If database 1 is connected, save data to it</li>
  <li>If database 1 is not connected, check if database 2 is connected</li>
  <li>If database 2 is connected save data to it</li>
  <li>If database 2 is not connected, check if database 3 is connected</li>
  <li>If database 3 is connected, save data to it</li>
  </ol>
  
  <p>To be clear, is there a way to check that a database is connected in Laravel 5.1?</p>