I am creating a laravel project for which I need one laravel installation and use its instance in sub-domain with separate database. And th
You can set DB configuration by doing this:
$tenant = Tenant::whereSubDomain($subdomain)->first();
Config::set('database.connections.mysql.database', $tenant->db_name);
Config::set('database.connections.mysql.username',$tenant->db_username);
Config::set('database.connections.mysql.password',$tenant->db_password);
dd(\DB::connection('mysql'));
See this link Set up dynamic database connection on Multi tenant application for your reference.