We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f462420 commit 5f755feCopy full SHA for 5f755fe
src/Jenssegers/Mongodb/MongodbServiceProvider.php
@@ -13,12 +13,6 @@ class MongodbServiceProvider extends ServiceProvider {
13
*/
14
public function boot()
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
-
22
Model::setConnectionResolver($this->app['db']);
23
24
Model::setEventDispatcher($this->app['events']);
@@ -31,7 +25,13 @@ public function boot()
31
25
32
26
public function register()
33
27
34
- // Nothing.
28
+ $this->app->resolving('db', function($db)
29
+ {
30
+ $db->extend('mongodb', function($config)
+ return new Connection($config);
+ });
35
}
36
37
0 commit comments