Graphify before you refactor: how I map a Laravel codebase in 10 minutes
Short answer: Before a multi-file Laravel refactor, I run Graphify (graphify update .) and read graphify-out/GRAPH_REPORT.md for god nodes and communities—then I know which controllers, writers, and tests must move together.
What is Graphify? explains the concept; this is my weekly habit on aviwebsquad.in.
When I run it
- Before Rector upgrades across
app/ - Before splitting a fat
BlogController - After adding MCP writers (
BlogPostMcpWriter,PageMcpWriter) - When Cursor agents touch >3 files in one task
What I look for in GRAPH_REPORT.md
- God nodes — classes with fan-in/fan-out spikes (
BlogPost,SeoSettings, route files) - Communities — Filament vs HTTP vs MCP API clusters should stay separated
- Surprise edges — e.g., SEO logic leaking into models
If Graphify shows FaqJsonLdBuilder only connected to three controllers, I know exactly where to add tests when changing JSON-LD.
Pairing with automated refactors
Rector is fast and blind. Graphify is slow-ish and sees structure. Order:
graphify update .
rector process --dry-run
pest --filter=Seo
MCP agents read the same graph
Project rules tell agents to read Graphify output before architecture answers—reduces “edit the wrong file” failures when using secure MCP APIs.
FAQ
Cost?
AST-only Graphify updates are local—no API spend on this project.
Replace static analysis?
No—combine with Larastan. Graphify answers relationships, Larastan answers types.
Too small a repo?
Under ~20 PHP files, ripgrep is enough. Aviwebsquad crossed the threshold when Filament + MCP landed.
Maintenance note (Sep 2026)
Re-validated internal links and examples against the live aviwebsquad.in CMS after the Hostinger migration; guidance in this article still matches production.