Normally in Laravel you get a request bag with all parameters in it. But in a service provider this is not the case. But we do have the request()
object.
Both boot() and register() methods of any service provider are called before request is parsed and request parameters are known, that's why you can't access them.
Service providers are supposed to register services and shouldn't depend on the request context. If you want to use request parameters in your services, declare request service as a dependency of your service so that it's injected the moment your service gets instantiated.