Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Corys8646's avatar

Remembering Query Scopes and Accessors

This is more of a general question and something that keeps popping up for me.

When I initially develop an app, I will invariably create Query Scopes and Accessors on my models. That works great when i'm deep in a project.

When coming back a few weeks later, I find myself rewriting those queries in the controller, forgetting I already have them on my model. Or inlining the same code I already have as an accessor in my blade file.

Maybe it's my crappy memory and just have to review the model again before writing new code, but just thought I would ask if anyone has tips or tricks on this subject.

0 likes
0 replies

Please or to participate in this conversation.