I got too many SQL queries in the controller. In the sense, the queries themselves are not so many, but they are rather long. I think about where it would be better to take them out of the controller. Maybe create a model of the page and put it there?
Only kindly request - do not respond in an abstract way like "this can be done in a variety of ways, and not count them all." Please suggest a specific solution that you consider to be the best.
I especially liked this example of the organization of the model proposed at Laracasts :
app /myApp (or project) /posts (post example, but same for all product features, Users, etc. I remove directories that are not relevant) /repository /contracts /commands /services /exceptions /events /documentation (I like to keep project documentation in the relevant areas vs centralized ) /middleware Abstract class Post.php (model) PostManager.php (management code) I still do not fully understand the purpose and features of all these elements of the model, but I would like to understand.