Answer the question
In order to leave comments, you need to log in
Laravel 5. Service provider in Laravel, what is it for?
Do I understand correctly that the main task of a service provider is to implement the scheme - "one interface, many implementations"? That is, we make a bind whose key corresponds to some interface, and pass the implementation class itself as the second parameter.
$this->app->bind('App\Contracts\Article', 'App\Services\ArticleEloquent');
Answer the question
In order to leave comments, you need to log in
No, this is one of the features. The purpose of the provider is to centrally connect and initialize the necessary application components (via bind, share, singleton - it doesn’t matter), as well as perform other global (within the application) tasks.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question