beerbuddha's avatar

Upgrading from 5.3 to 5.4 Lumen Request

According to the Lumen documentation for upgrading to 5.4 Lumen

Requests In Service Providers

If you were previously accessing the current request in one of your application's service providers, you should refactor your code to use a middleware instead.

I don't understand this, can someone provide me with an example of what was done in 5.* (incorrectly) and how I should be refactoring this to be more in line of 5.4

0 likes
2 replies
beerbuddha's avatar

in summary:

don't take the request obj during service provider, do it durring middlewear due to singleton loading of lumen object which is binded later in the cycle therefore it becoming empty during service provider boot up cycle.

Please or to participate in this conversation.