title: How set global variable for all request in Laravel
body: <p>How can I set at run time a global variable that is visible for all request? After login user, I need to save the data of DB connection and connect to his database in all request (with a middleware). <br><br>I just proved <code>$GLOBALS</code> of PHP and <code>app()-&gt;singleton()</code> of Laravel, but, in both case, after the request I lose the content of variable.Why? </p>
  
  <p>And how can I resolve? I don't want put the db data to session or cache.</p>