title: Laravel change database connection
body: <p>How can a database connection be changed when user is admin role? Admin database contains information that must not be accessible to other user's and requirement also is that database must be located on own server. I do have currently separate configuration for admin connection.</p>
  
  <pre><code>'mysql' =&gt; [
      'host'      =&gt; 'admin.psa44.localhost'
      'driver'    =&gt; 'mysql',
      'database'  =&gt; 'database',
      'username'  =&gt; 'root',
      'password'  =&gt; 'secretpassword',
      'charset' =&gt; 'utf8mb4',
      'collation' =&gt; 'utf8mb4_unicode_ci',
      'prefix'    =&gt; '',
  ],
  </code></pre>
  
  <p>I want that no hardcoding is in application so how can Laravel do the switch when necessary? Thanks for any help.</p>