File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,12 @@ class MongodbServiceProvider extends ServiceProvider {
13
13
*/
14
14
public function boot ()
15
15
{
16
+ // Add a mongodb extension to the original database manager.
17
+ $ this ->app ['db ' ]->extend ('mongodb ' , function ($ config )
18
+ {
19
+ return new Connection ($ config );
20
+ });
21
+
16
22
Model::setConnectionResolver ($ this ->app ['db ' ]);
17
23
18
24
Model::setEventDispatcher ($ this ->app ['events ' ]);
@@ -25,15 +31,7 @@ public function boot()
25
31
*/
26
32
public function register ()
27
33
{
28
- // Add a mongodb extension to the original database manager,
29
- // when the database instance is being resolved.
30
- $ this ->app ->resolving ('db ' , function ($ db )
31
- {
32
- $ db ->extend ('mongodb ' , function ($ config )
33
- {
34
- return new Connection ($ config );
35
- });
36
- });
34
+ // Nothing.
37
35
}
38
36
39
37
}
You can’t perform that action at this time.
0 commit comments