Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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');
 
PREVIOUS NEXT
Tagged: #laravel #change #db #connection #fly
ADD COMMENT
Topic
Name
9+4 =