Categories
Javascript Laravel

Change DB Connection at Runtime in Laravel

\Config::set("database.connections.mysql", [
    "host" => "your-host.com",
    "driver" => "mysql",
    "database" => 'database-name',
    "username" => "username",
    "password" => "password",
]);
\DB::purge('mysql');

Leave a Reply

Your email address will not be published.