Closed GromNaN closed 3 months ago
Correct me if I'm wrong, but doesn't this fix render the code from the register method useless?
If I'm correct in assuming that the idea was to extend the BatchRepository service provider for the case where the queue batching driver was set to mongodb, then the proposed solution will invalidate that solution.
It's also true that the way the BatchRepository resolver has been extended never actually worked. I think that's the actual bug that needs fixing.
Ok, I think I've found how this should be done.
Illuminate\Bus\BusServiceProvider
is a DeferrableProvider
. It's registered only when one of the services it provides is requested. But by extending this service in my provider, I replace the service provider that is registered. I with Laravel would call every providers that provide a given service, but there is only one.
I need to explicitly register the Illuminate\Bus\BusServiceProvider
when my provider is registered.
Ideally that could be solved in Laravel: https://github.com/laravel/framework/discussions/52251
Fix PHPORM-222 Fix #3060
MongoDBBusServiceProvider
is not the provider ofBatchRepository
. I could not reproduce the issue described in #3060, but it looks like this change should fix it.Checklist