Skip to content

Commit 96be808

Browse files
committed
Merge pull request #268 from franzliedke/patch-1
Only extend database when it is actually resolved.
2 parents 27b5206 + f39c67a commit 96be808

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Jenssegers/Mongodb/MongodbServiceProvider.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ public function boot()
2525
public function register()
2626
{
2727
// Add a mongodb extension to the original database manager
28-
$this->app['db']->extend('mongodb', function($config)
29-
{
30-
return new Connection($config);
28+
$this->app->resolving('db', function($db) {
29+
$db->extend('mongodb', function($config)
30+
{
31+
return new Connection($config);
32+
});
3133
});
3234
}
3335

0 commit comments

Comments
 (0)