What are service providers in laravel?

Report
Question
780 views

Service providers in laravel application is the central place where application is bootstrapped. That is, laravel’s core services and our application’s services, classes and their dependencies are injected in service container through providers.

Please explain why do you think this question should be reported?

Report Cancel

More simpler definition may be given as, providers are funnel/nozzle through which we pour fuel called classes into a fuel tank called service container of an engine called Laravel.

For example, open config/app.php, and find an array with name “providers”

'providers' => [ 
/* * Laravel Framework Service Providers... */ 
Illuminate\Auth\AuthServiceProvider::class, 
Illuminate\Broadcasting\BroadcastServiceProvider::class, 
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class, Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, Illuminate\Cookie\CookieServiceProvider::class,
 . . . 
],

Thread Reply

Leave an comment

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>