Where to write service invocation?

Because indexing js applications by search engines is HS I quickly started to think what to do. Just came to mind Go to do the face. Fiddle a couple of days its templating engine. Did NOT like.

I took so php and wrote on it the client for their services (with the amendments. Now, instead of hash + open data at the network runs xxtea + base64. Much less traffic eats). The benefit of PHP is so simple that looking at the source code of the client to Go I dropped down, too, on PHP in 10 minutes. Now services running in docker containers. Test and see that in General the query worked for 8 MS.

Put laravel5. Authorization service rendered to him (Yes. Throw tomatoes). All the logic I write the models and controllers just validation and challenge views. Cm. MVC active model.

As the model was going to write requests to the services. While all like it (perhaps because of static typing to PHP. Not the point). But here asked the question because suddenly you can make it even prettier and I don't even know.
July 8th 19 at 15:42
2 answers
July 8th 19 at 15:44
Solution
Cm. MVC active model.


Where to look? The model is always active, it is the same model. And when the logic in the controllers is the lack of separation.

perhaps because of static typing to PHP. Not the point


In PHP, dynamic typing, and even worse, a weak dynamic.

As the model was going to write requests to the services.


In addition to the models eloquent you have the ability to do services. Here there and phite. Doesn't matter who acts as a "model", the entities or services. Their task is to query status and to form the passive view.
I'm doing that. You have not understood correctly. There is also the passive model (without logic). Typing in php7 - Brody_Dickins commented on July 8th 19 at 15:47
that is not passive and anemic model. And again, in the case of a passive model you have the logic should leak into the controller and then how would you can forget all about the fact that we have this separation. Then the controller becomes a model and there is a high coupling of model and view (since there is no pick between them and the model is forced to prepare a submission).

Typing in php7 is the same what was in php5, weak dynamic. Typehinting help but not much. With dynamic type system easier to work with. - Allene_Crona78 commented on July 8th 19 at 15:50
clarify just in case. What is the question? Where to make requests to external services in the services. In the case of autorizaci - service user providers I guess.

In your question too much vastausta and very little issue. - Allene_Crona78 commented on July 8th 19 at 15:53
: I wrote what to do in the model all logic. But if you look the Doc of laravale there models just get the data from dB WITHOUT any logic. That's written right here do. - Brody_Dickins commented on July 8th 19 at 15:56
: hammer on terminology laravel. The model in the context of the eloquent model is a separate entity and not the entire subject area (not all business logic can be in the entity).

It was the service layer. In fact, the "model" in the context of MV* units this app without UI. It is not one class. Moreover, from the perspective of each view function the model for her is the vertex count of the object with which it comes in contact only.

In short, the services is good. Controllers should not particularly know the difference between services and entities. It's just objects. - Allene_Crona78 commented on July 8th 19 at 15:59
July 8th 19 at 15:46
Solution

Find more questions by tags GoLaravelPHP