From the course: Advanced Laravel

Unlock the full course today

Join today to access over 24,500 courses taught by industry experts.

Service providers in Laravel

Service providers in Laravel - Laravel Tutorial

From the course: Advanced Laravel

Service providers in Laravel

- [Instructor] Now that we know how a service container in Laravel manages the objects and their dependencies, we can look at something called service providers. A service provider is a class that is responsible for registering the services or dependencies for your application. So service provider is a place where you do the binding part of using the service container. The core Laravel framework provides several built-in service providers that register various services for you, such as routing, database, validation, and encryption. Let's take a look at one of the core service providers in the Laravel. The ViewServiceProvider. This service provider is responsible for registering the view component of Laravel, which is used to render the views in your application. Look at the main register method that calls the registerFactory method. It registers the view component with the service container by binding it to the view key.…

Contents