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
It's not meant that you execute services like this in a service provider's register method. The register methods are only there to wire things into Laravel's container. The boot method is the correct place for this.
Description:
It seems that pushMiddlewareToGroup is not working when inside a provider register method
Steps To Reproduce:
Add a middleware inside register method, it does not work :
middleware is not called at all.
add the same code in boot() method and see that it works
it was working fine on v8.25.0
My Use Case
i'm using https://github.com/NoelDeMartin/laravel-dusk-mocking to mock some facades inside my dusk tests, like Socialite,
and since their middleware is added in their provider, it cease to work at some point.
if i edit this file :
https://github.com/NoelDeMartin/laravel-dusk-mocking/blob/master/src/MockingServiceProvider.php
and move
pushMiddlewareToGroup
calls to the boot method, it works again.thanks.
The text was updated successfully, but these errors were encountered: