Allow anonymous connection

- If no user was given an empy user was set resulting in an error
parent a1ed46f2
...@@ -137,11 +137,11 @@ class Connection extends \Illuminate\Database\Connection ...@@ -137,11 +137,11 @@ class Connection extends \Illuminate\Database\Connection
} }
// Check if the credentials are not already set in the options // Check if the credentials are not already set in the options
if (!isset($options['username'])) { if (!isset($options['username']) && isset($config['username'])) {
$options['username'] = isset($config['username']) ? $config['username'] : ''; $options['username'] = $config['username'];
} }
if (!isset($options['password'])) { if (!isset($options['password']) && isset($config['password'])) {
$options['password'] = isset($config['password']) ? $config['password'] : ''; $options['password'] = $config['password'];
} }
return new Client($dsn, $options, $driverOptions); return new Client($dsn, $options, $driverOptions);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment