Answer the question
In order to leave comments, you need to log in
Laravel. What functionality should be moved to services?
There are methods that create new records in the database, download information from an external source, and process the file uploaded to the server. Now all this lies in the controllers.
Will I do the right thing if I put all this into services? That is, the controllers will turn out to be as thin as possible and, in fact, in most cases they will conditionally call the necessary services, the models will store information about the links / fields, etc., and all the work will be done in the services.
There are quite a few such services. Is this the correct approach?
Answer the question
In order to leave comments, you need to log in
There is a good rule - in any incomprehensible situation, create a new service. The main thing here is to feel the border of reason, so as not to get too layered cake. By the way, the controller itself should also be perceived as a service.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question