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 {
1313 */
1414 public function boot ()
1515 {
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+
1622 Model::setConnectionResolver ($ this ->app ['db ' ]);
1723
1824 Model::setEventDispatcher ($ this ->app ['events ' ]);
@@ -25,15 +31,7 @@ public function boot()
2531 */
2632 public function register ()
2733 {
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.
3735 }
3836
3937}
You can’t perform that action at this time.
0 commit comments