title: Get specific database connection string while logging and connect to that database dynamically in laravel 8?
body: <p>I developed a web accounting application using vanilla PHP as backend and jquery and vanilla javascript as frontend. Every client will have one database. The single database contains all client's database connection strings and login credentials for clients. Whenever a client logs in using a login credential client gets the connection string from the master database where all database connections are stored. Based on login credentials my backend will connect to their database. They will work on their database.</p>
  <p><a href="https://i.stack.imgur.com/EiKP3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EiKP3.png" alt="enter image description here" /></a></p>
  <p>How can i achieve this scenario using laravel 8? i tried several solutions like,
  <a href="https://stackoverflow.com/questions/38270006/dynamic-database-connection-in-laravel">Dynamic database connection in Laravel</a>,
  <a href="https://stackoverflow.com/questions/53755620/create-dynamic-database-connection-in-laravel">Create Dynamic Database Connection in Laravel</a>,
  <a href="https://stackoverflow.com/questions/56118584/laravel-5-8-dynamic-database-connection-not-being-set-in-model">Laravel 5.8 dynamic database connection not being set in model</a>,
  <a href="https://stackoverflow.com/questions/42975257/laravel-5-4-dynamic-database-connection">laravel 5.4 dynamic database connection</a>,
  <a href="https://stackoverflow.com/questions/65907953/configure-database-connections-on-the-fly-in-laravel">Configure database connections on the fly in Laravel</a></p>
  <p>these all solutions recommend using configure file or .env file. as you can see in my scenario i can't setup every client's database connection in database config array because my client's database connections are dynamic and there are lots of database connections.</p>
  <p>so what you guys will suggest to overcome this scenario?</p>
  <p>and i don't want to use Multi-Tenant setup its just overkill and i do want is grab connection string while logging and use that connection string to connect user's specific database. so its kind a dynamic!</p>