Answer the question
In order to leave comments, you need to log in
Does it make sense to create your own service providers within the same project?
Let's say there is a certain project within which, say, work will be carried out with a certain external API (or something like that, it doesn't matter, just some relatively separate piece of functionality).
Does it make sense to design this functionality in the form of a service provider?
And if so, which one?
Or just leave the class and connect as usual.
What is the point of these service providers, if you can do everything without it and everything will be fine and convenient.
Please answer in simple words or with an example :)
Answer the question
In order to leave comments, you need to log in
For a medium project, the AppServiceProvider is enough if you're not a purist.
But, judging by the question, it seems that you mixed some entities with each other. The provider is used to register your class in the DI container. Using a DI container is more convenient than new Class.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question