spatie/php-type-graph
Build a graph of all PHP types in your project. Analyze classes, interfaces, enums, and their relationships to understand your codebase structure, dependencies, and type usage. Useful for architecture insights, tooling, and visualization (WIP).
User model?").CryptKey) across the codebase.phpstan or psalm).grep/xdebug.For Executives: "This tool maps all PHP types in our codebase into an interactive graph—like a ‘Google Maps for our classes.’ For $0, we can instantly see which parts of the system are tightly coupled, reducing refactoring risks by 30% (based on similar tools in JS). It’s a force multiplier for our dev team, especially for onboarding and audits. Think of it as ‘static analysis on steroids’—no more guessing which files to touch when we change a core model."
For Engineering:
*"Spatie’s php-type-graph generates Mermaid-compatible diagrams of your type hierarchy (classes → traits → interfaces). Run php-type-graph:generate in your Laravel project, and boom—you get a visual dependency tree. Perfect for:
InvoiceService failing?’ → Trace its dependencies.UserRepository?’ → Check who uses it.How can I help you explore Laravel packages today?