Add credentials to options array in config

parent f3c646e9
......@@ -117,10 +117,10 @@ And add a new mongodb connection:
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', 27017),
'database' => env('DB_DATABASE', ''),
'username' => env('DB_USERNAME', ''),
'password' => env('DB_PASSWORD', ''),
'options' => [
'db' => 'admin' // sets the authentication database required by mongo 3
'db' => 'admin', // sets the authentication database required by mongo 3
'username' => env('DB_USERNAME', ''),
'password' => env('DB_PASSWORD', ''),
]
],
```
......
......@@ -135,10 +135,6 @@ class Connection extends \Illuminate\Database\Connection
if (isset($config['driver_options']) && is_array($config['driver_options'])) {
$driverOptions = $config['driver_options'];
}
// Get the credentials from the config and check if they are set
$options['username'] = isset($options['username']) ? $config['username'] : '';
$options['password'] = isset($options['password']) ? $config['password'] : '';
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