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
I've already filed an extensive bug report in the laravel/framework repository, which has been rejected. I am not yet 100% convinced that this not at least partly a framework problem.
Once the auditing package is installed, Laravel's event auto-discovery no longer works. This means that events and listeners from my application will not be detected. I (want to) rely on auto-discovery.
I have found that the framework's EventServiceProvider is no longer registered once another service provider inheriting from that base class is registered. This is the case for your service provider. I am still trying to figure out how the framework works and registers those service providers.
As the auditing service provider is registered instead the framework's service provider, this check in shouldDiscoverEvents will return false.
Expected Behaviour
Using your package, Laravel's EventServiceProvider is still registered and event auto-discovery works as expected.
Check the output of (8) and (10) and you will see that at (8) the event and listener are discovered while at (10) they no longer are.
Please have a look at the code in the original bug report.
Possible Solutions
If this package would rely on Manual Registering Events, i.e. not inheriting and not using the $listen array anymore, but instead using the facade in any of the boot functions, I think the problem could be solved.
On the other hand, I still think this is a bug in the framework.
The text was updated successfully, but these errors were encountered:
Actual Behaviour
I've already filed an extensive bug report in the laravel/framework repository, which has been rejected. I am not yet 100% convinced that this not at least partly a framework problem.
Once the auditing package is installed, Laravel's
event auto-discovery
no longer works. This means that events and listeners from my application will not be detected. I (want to) rely on auto-discovery.I am pretty sure this is caused by the AuditingEventServiceProvider inheriting from the framework's base EventServiceProvider.
I have found that the framework's
EventServiceProvider
is no longer registered once another service provider inheriting from that base class is registered. This is the case for your service provider. I am still trying to figure out how the framework works and registers those service providers.As the auditing service provider is registered instead the framework's service provider, this check in shouldDiscoverEvents will return
false
.Expected Behaviour
Using your package, Laravel's EventServiceProvider is still registered and
event auto-discovery
works as expected.Steps to Reproduce
Check the output of (8) and (10) and you will see that at (8) the event and listener are discovered while at (10) they no longer are.
Please have a look at the code in the original bug report.
Possible Solutions
If this package would rely on Manual Registering Events, i.e. not inheriting and not using the
$listen
array anymore, but instead using the facade in any of theboot
functions, I think the problem could be solved.On the other hand, I still think this is a bug in the framework.
The text was updated successfully, but these errors were encountered: