📜  laravel 即时更改数据库连接 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:11.207000             🧑  作者: Mango

代码示例1
config(['database.connections.onthefly' => [
            'driver' => $params->driver,
            'host' => $params->host,
            'username' => $params->username,
            'password' => $params->password
        ]]);

        return DB::connection('onthefly');