The Laravel Actions Pattern: Single-Purpose Classes That Do One Thing Well
Replace fat controllers and bloated services with focused Action classes. One class, one job, fully testable. A modern alternative to the Service-Repository pattern.
6 articles
Writing clean, maintainable code. Learn about code readability, refactoring techniques, naming conventions, and principles for sustainable software development.
Replace fat controllers and bloated services with focused Action classes. One class, one job, fully testable. A modern alternative to the Service-Repository pattern.
Stop repeating collection logic. Learn how to extend Laravel Collections with Macros, Mixins, and how to test them effectively for cleaner code.
Refactor complex business logic into maintainable, distinct steps using Laravel's Pipeline utility. Perfect for checkouts, data processing, and workflow management.
Stop passing associative arrays everywhere. Use PHP 8.2 readonly classes to create type-safe, immutable Data Transfer Objects in your Laravel applications.
Leveraging PHP 8.1+ Enums to clean up your Laravel models, validation logic, and database interactions.
Is your controller method 100 lines long? Here are 5 proven strategies to clean it up and make your code reusable and testable.