Refactoring
Refactoring is a very important rule to look back on when working on a project, the importance of refactoring code means future legacy code will be more readable and therefore appear less complicated to add or resolve possible issues
April 3, 2026
Your Laravel Controllers Are Doing Too Much. Fix Them With Services
If you've ever scrolled through a Laravel controller method that stretches past 150 lines, you already know something went wrong. That store() method started innocent enough: a couple of...
March 17, 2024
Discovering Laravel Latest Eloquent Methods: whereAll & whereAny
In the ever-evolving world of web development, Laravel continues to introduce features that simplify and enhance the coding experience. The recent Laravel 10.47 update has brought us two innovative...
ReadSeptember 7, 2021
Refactoring to whereRelation method
Previously in Laravel when you wanted to get a relation and include an extra complex condition you had to do it with the whereHas method in the following way:
Recently DarkGhostHunter...
September 2, 2021
Avoiding the N+1 problem in Laravel
Let's do some piggybacking on our code from Tip #1. Note how we fetch the User model for a given participant in the average function. This is highly problematic, because we're doing an additional...
ReadAugust 31, 2021
Refactoring to Laravel Collections
How you can avoid loops by using collections. It sounds great from the beginning but you need to practice it in order to be able to use it in your own projects.. Imagine you are developing a web...
Read