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

Roles and Permissions in Laravel 13

14 lessons
57 min

Testing in Laravel 13 For Beginners

26 lessons
1 h 41 min read

Laravel 13 Eloquent: Expert Level

41 lessons
1 h 34 min
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