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