service provider in laravel

Posted by w3diy - 7 months ago

service provider in laravel : Service providers can be defined as the central place to configure all the entire Laravel applications.

The Artisan CLI can generate a new provider via the make:provider command: An artisan command is given here which can be used to generate a service provider:

php artisan make:provider RiakServiceProvider

Almost, all the service providers extend the Illuminate\Support\ServiceProviderclass. Most of the service providers contain below-listed functions in its file:

  1. Register() Function
  2. Boot() Function

Within the Register() method, one should only bind things into the service container.