Laravel 11 automatically disable events auto discovery if a different instance of EventServiceProvider is loaded. This is handle by shouldDiscoverEvents method at line 137 in Illuminate/Foundation/Support/Providers/EventServiceProvider.php.
Since Orchid extend and register it's own version of EventServiceProvider the class check at get_class($this) === __CLASS__ starts to fail since it's executed with an instance of Orchid EventsServiceProvider.
I propose to override the shouldDiscoverEvents in order to match get_class and __CLASS__ values and re-enable the auto discovery.
Fixes #2828
Proposed Changes
Laravel 11 automatically disable events auto discovery if a different instance of EventServiceProvider is loaded. This is handle by
shouldDiscoverEvents
method at line 137 in Illuminate/Foundation/Support/Providers/EventServiceProvider.php. Since Orchid extend and register it's own version ofEventServiceProvider
the class check atget_class($this) === __CLASS__
starts to fail since it's executed with an instance of OrchidEventsServiceProvider
.I propose to override the
shouldDiscoverEvents
in order to matchget_class
and__CLASS__
values and re-enable the auto discovery.