Skip to main content
Video

Laravel Code from Controller into Service: The Right Way

February 13, 2020

Enjoyed This Tutorial?

Get access to all premium tutorials, video and text courses, and exclusive Laravel resources. Join our community of 10,000+ developers.

Recent Courses on Laravel Daily

Laravel 13 Starter Kit Teams and Customizations

10 lessons
33 min

Roles and Permissions in Laravel 13

14 lessons
57 min

How to Structure Laravel 13 Projects

16 lessons
1 h 32 min read
avrahamm 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?

Povilas Korop 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.

👍 1