laravel change db connection on the fly
config(['database.connections.onthefly' => [
'driver' => $params->driver,
'host' => $params->host,
'username' => $params->username,
'password' => $params->password
]]);
return DB::connection('onthefly');