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
All service providers extend the Illuminate\Support\ServiceProvider class. Most service providers contain a register and a boot method. Within the register method, you should only bind things into the service container. You should never attempt to register any event listeners, routes, or any other piece of functionality within the register method.
As stated in the laravel document.The registration of listener should not be placed on register. This is the current provider code:
$this->app['db'] will cause db to be instantiated,Any provider executed after that, if it contains changes to db, will be ignore because the db is instantiated in advance.
There is a bug, which causes the official package of laravel-mongodb not to be correctly register in the resolving callback of db. This bug is modified by the official suggestion of mongodb.
see mongodb/laravel-mongodb#2715 (comment)
So the solution to the problem is that db should not be instantiated in register, which does not conform to the specification of laravel and can lead to conflicts between packages.
The text was updated successfully, but these errors were encountered:
This caused me a headache for 3 days. I had to slowly remove packages from composer.json to discover this package was the issue. I use Laravel 11 and MongoDB Laravel and this package would prevent me from adding MongoDB as a new connection. Please update!
As stated in the laravel document.The registration of listener should not be placed on register. This is the current provider code:
$this->app['db'] will cause db to be instantiated,Any provider executed after that, if it contains changes to db, will be ignore because the db is instantiated in advance.
There is a bug, which causes the official package of laravel-mongodb not to be correctly register in the resolving callback of db. This bug is modified by the official suggestion of mongodb.
see mongodb/laravel-mongodb#2715 (comment)
So the solution to the problem is that db should not be instantiated in register, which does not conform to the specification of laravel and can lead to conflicts between packages.
The text was updated successfully, but these errors were encountered: