beyondcode/laravel-er-diagram-generator
Generate entity-relationship diagrams directly from your Laravel models. This package inspects your Eloquent relationships and produces a visual ER diagram with Graphviz, making database structure easy to understand and share with your team.
Architecture fit
beyondcode/laravel-er-diagram-generator is a dev-only Artisan tool: composer require --dev, then php artisan erd:generate introspects Eloquent models and relationships, emits Graphviz DOT, and renders SVG/PNG/PDF. There is no request-path runtime footprint and negligible production blast radius, which means a TPM can sponsor adoption without a change-advisory board conversation.
The TPM value is a code-derived planning artefact, not a diagramming hobby. It supports four recurring planning needs: sizing data-heavy features before commitment (which models and relationships are actually in play), migration blast-radius assessment (shared-table refactors, shared-schema integrations), onboarding where schema knowledge otherwise lives in two engineers' heads, and schema-debt prioritization (orphan models, over-connected tables, polymorphic hotspots as leading indicators of future delivery drag). The critical framing to hold: it reflects models, not the live database — a navigation aid, never a source of truth.
Integration feasibility High. The total cost is a dev dependency, an optional published config, and a Graphviz binary on developer machines and in CI. Nothing else moves.
Release 6.0.0 adds capability that matters specifically to a TPM's use cases: model aliases produce business-legible diagrams ("Customer" rather than App\Models\CustAcct), which is the difference between an artifact engineers tolerate and one you can put in front of product or leadership; ignore_columns suppresses audit, soft-delete, and PII-adjacent fields so output is reviewable rather than a wall of timestamps; column types via Laravel getColumns() improve accuracy; and Laravel 13 compatibility keeps it viable on the forward roadmap. Aliasing is the highest-leverage feature for stakeholder communication — prioritize it over cosmetic tuning.
Technical risk
Moderate, concentrated almost entirely in the 5.x → 6.0.0 major bump rather than in the tooling. The changelog reads additive, but it does not enumerate breaking changes; likely risk areas are raised PHP/illuminate/* constraints and changed type-string rendering from the getColumns() switch. Published configs from 5.x may lack the new ignore_columns key, so default behavior must be verified rather than assumed. Graphviz is an unmanaged external dependency and the most common source of opaque failures. Introspection cost rises with model count and per-table database round-trips. Provenance is thin — small contributor base, changelog-only upgrade guidance — which is acceptable for a dev tool but means there is nobody to escalate to; the mitigation is a diff gate, not a support contract.
Key questions
php and illuminate/* constraints in 6.0.0, and which Laravel lines were dropped relative to 5.0.0?getColumns() change emitted type strings, and is that diff acceptable to diagram consumers?ignore_columns — empty, or a sensible baseline?Stack fit Excellent for a Laravel monolith or Laravel-first service with a meaningful Eloquent layer — roughly 30+ models is the practical threshold where manual diagramming stops being viable and the tool starts paying for itself. Poor fit for thin API services over an external database, non-Laravel or heavily mixed stacks, or teams already generating schema documentation from migrations or a dedicated modelling platform. Because diagrams derive from models, they can silently diverge from the real schema; say so in the internal README rather than letting someone discover it in a design review.
Migration path
composer.json constraints against the app's composer.lock; stop at 5.x if a PHP or Laravel line the app depends on was dropped..dot output. Classify every diff as cosmetic, expected, or suspicious before merging — this is the acceptance gate, and it is the single control that makes a changelog-only upgrade defensible.ignore_columns deliberately: exclude created_at, updated_at, deleted_at, and PII-adjacent fields so diagrams are reviewable by non-authors.Compatibility Confirm three surfaces independently: PHP version, Laravel version, and Graphviz binary version, across developer machines and CI. Pin Graphviz in the CI image and document the prerequisite — this is the most likely "works on my machine" ticket and the cheapest one to preempt.
Sequencing
This is not a roadmap item and should not consume a planning slot. It is low-risk, self-contained background maintenance a single engineer lands in a sprint alongside feature delivery — no coordination overhead, no release-train dependency, no user-facing change. Recommended order: constraint audit → branch bump → output diff → config and ignore_columns → aliases → CI regeneration → short internal README.
Maintenance
Near-zero steady state, but not zero. Recurring chores: bump the package alongside Laravel majors, keep Graphviz current, regenerate diagrams when models change. Because it tracks Laravel internals through getColumns(), expect breakage on Laravel majors until upstream ships compatibility — budget a few hours per major upgrade and do not treat lag as an incident.
Support
Support is confined to developers: no on-call surface, no user-facing SLA, no production security exposure, no vendor relationship. Realistic tickets are "it doesn't work" issues caused by missing Graphviz, version-constraint mismatches, or stale config. A one-page internal README covering the Graphviz prerequisite and the baseline ignore_columns list eliminates most of that burden permanently.
Scaling Fine for dozens to low hundreds of models. At 200+ models a single global diagram becomes dense and stops being useful as a review artifact, and per-table column introspection round-trips add up — noticeably so if CI points at a remote or ephemeral database. Mitigate with scoped or filtered diagrams if config supports model subsets; otherwise accept multiple targeted runs and plan for one diagram per bounded context.
Failure modes
Missing or mismatched Graphviz produces opaque command errors and inconsistently rendered output. Model introspection underrepresents polymorphic and runtime-resolved relationships, so diagrams will understate complexity exactly where complexity is highest. Diagrams can diverge from the real database. Committed artifacts can go stale between regenerations. Major-version bumps can silently change type rendering or table coverage. Mitigations map one-to-one: pin Graphviz, generate in CI rather than locally, gate upgrades on the .dot diff, set a deliberate ignore_columns baseline, and state in the README that these are navigation aids.
Ramp-up Well under a day for a single engineer: install, publish config, set the ignore list, run the command, write the README. Stakeholder ramp-up is also low once aliases are in place, because the diagram speaks domain vocabulary instead of PHP class names — that is what makes it usable in a planning review without an engineer narrating it.
TPM framing: pitch this as a free, MIT-licensed developer tool that closes a documentation gap at essentially zero cost and zero production risk, paying back through faster onboarding, lower-risk schema changes, and a shared diagram for planning conversations. Be explicit about the boundary: this is not a data-governance, lineage, or enterprise catalog platform. If cross-system lineage is later needed, that is a separate buy decision with its own business case — this package neither precludes nor substitutes for it.
How can I help you explore Laravel packages today?