Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
laravel-mongodb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sinan
laravel-mongodb
Commits
eaf2b8f1
Commit
eaf2b8f1
authored
Feb 25, 2016
by
Robert-John van Doesburg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add credentials to options array in config
parent
f3c646e9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
7 deletions
+3
-7
README.md
README.md
+3
-3
Connection.php
src/Jenssegers/Mongodb/Connection.php
+0
-4
No files found.
README.md
View file @
eaf2b8f1
...
...
@@ -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'
,
''
),
]
],
```
...
...
src/Jenssegers/Mongodb/Connection.php
View file @
eaf2b8f1
...
...
@@ -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
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment