🔴 Laravel
Beginner
What are Service Providers in Laravel?
Answer
Service Providers are the central place for bootstrapping Laravel applications. They register service container bindings, event listeners, middleware, and routes. Every service provider extends Illuminate\Support\ServiceProvider and has two main methods: register() (bind things into the container — only bindings here, no access to other services) and boot() (called after all providers are registered — safe to use any service). All service providers are registered in config/app.php under the providers array. When you install a Laravel package, it often registers its own service provider automatically via the extra.laravel.providers key in its composer.json (package discovery).