Writing Service Providers
All service providers extend the Illuminate\Support\ServiceProvider
class. Most service providers contain a register
and a boot
method. Within the register
method, you should only bind things into the service container. You should never attempt to register any event listeners, routes, or any other piece of functionality within the register
method.
The Artisan CLI can generate a new provider via the make:provider
command:
php artisan make:provider RiakServiceProvider