You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Register the Mongo driver through the make function instead of resolving functiong
If db is instantiated in another package, then the callback function registered through resolving function will not be executed, which is a hidden BUG.
This problem does not occur stably, only if a package is sorted by the composer and executes its own provider before the laravel-mongodb provider, and exactly instantiates db.
The core code is:
In my project, the following code exists in other packages, which can lead to problems. Because db is instantiated in advance:
Problems caused by,there is an error:
Unsupported driver [mongodb]. - InvalidArgumentException