Laravel Code from Controller into Service: The Right Way

avatar

This way all the long logic complexity is just moved one way down to the ReportService class. The long logic complexity was not splitted or simplified, just moved down. Is it worth it? Wouldn't it be better to try really split and simplify the logic and leave the simplified version in Controller method?

avatar

Good point, so I guess moving to service Service is the next step, and then that Service itself could be split into various sub-methods, later.