title: laravel database connection returns undefined index error
body: <p>I am developing a project using laravel 4 framework. In my database.php file I get the following error:</p>
  
  <pre><code>  Undefined index: driver 
  </code></pre>
  
  <p>And my connection is as following:</p>
  
  <pre><code>    $connections = array(
              'mysql' =&gt; array(
                  'read' =&gt; array(
                      'host'      =&gt; 'localhost',
                      'driver'    =&gt; 'mysql',
                      'database'  =&gt; 'app_system',
                      'username'  =&gt; 'root',
                      'password'  =&gt; 'root',
                      'charset'   =&gt; 'utf8',
                      'collation' =&gt; 'utf8_unicode_ci',
                      'prefix'    =&gt; '',
                  ),
                  'write' =&gt; array(
                      'host'      =&gt; 'localhost',
                      'driver'    =&gt; 'mysql',
                      'database'  =&gt; 'app_system',
                      'username'  =&gt; 'root',
                      'password'  =&gt; 'root',
                      'charset'   =&gt; 'utf8',
                      'collation' =&gt; 'utf8_unicode_ci',
                      'prefix'    =&gt; '',
                  ),
              ),
  
              'mysql2' =&gt; array(
                  'read' =&gt; array(
                      'host'  =&gt; 'localhost',
                      'driver'    =&gt; 'mysql',
                      'database'  =&gt; 'app_userdata',
                      'username'  =&gt; 'root',
                      'password'  =&gt; 'root',
                      'charset'   =&gt; 'utf8',
                      'collation' =&gt; 'utf8_unicode_ci',
                      'prefix'    =&gt; '',                      
                  ),
                  'write' =&gt; array(
                      'host'  =&gt; 'localhost',
                      'driver'    =&gt; 'mysql',
                      'database'  =&gt; 'app_userdata',
                      'username'  =&gt; 'root',
                      'password'  =&gt; 'root',
                      'charset'   =&gt; 'utf8',
                      'collation' =&gt; 'utf8_unicode_ci',
                      'prefix'    =&gt; '',                      
                  ),
              )
          );
  </code></pre>
  
  <p>I am also using environments in order to set different mysql connections. What is wrong with the code?</p>