Refactoring with Laravel Collection Macros: The Complete Guide
Stop repeating collection logic. Learn how to extend Laravel Collections with Macros, Mixins, and how to test them effectively for cleaner code.
5 posts
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.