Open zyz954489346 opened 8 months ago
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 https://github.com/mongodb/laravel-mongodb/issues/2715#issue-2104526953
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.