Service providers are the central place of all Laravel application bootstrapping. Your own application, as well as all of Laravel's core services are bootstrapped via service providers.
But, what do we mean by "bootstrapped"? In general, we mean registering things, including registering service container bindings, event listeners, middleware, and even routes. Service providers are the central place to configure your application.
If you open the
config/app.php file included with Laravel, you will see a
array. These are all of the service provider classes that will be
loaded for your application. Note that many of these are "deferred"
providers, meaning they will not be loaded on every request, but only
when the services they provide are actually needed.
In this overview you will learn how to write your own service providers and register them with your Laravel application.