I see a lot of different Laravel projects, and one consistent problem I see is application code that could be better leveraging a built-in feature of Laravel.
For example, I recently did a code review on a project that had an archived_at
column on a bunch of different tables. And then throughout controllers and model scopes, there was a lot of code to decide whether "archived" records should be returned.
This sounds suspiciously like soft deletes to me, which is already baked into Eloquent.
Sometimes Laravel will add a feature in a new version, and it may not make sense to immediately rewrite your code to use it, but soft deletes have been around almost since the beginning.
Lean into the framework and use what it offers. You'll write less code and other Laravel devs joining your team will be able to understand your code faster.
Here to help,
Joel
P.S. Want us to do a code review on your Laravel app? Book a call and let's talk about it.