I'm developing SaaS application using Yii2. I have a problem in setting db Connection. I'm using separate db structure for each Tenant. I have one login form with Tenant Company, username and password. Using company name I need to get database name, database username and database password which created for relevant tenant and establish db connection. Then need to validate login with entered username and password.
I tried as following example. https://forum.yiiframework.com/t/change-db-connection-dynamically/76412
But it sets the db connection after login, having validated the login from a common database connection. I need to validate connection from tenant database,
How I can get success output with above system requirements?