albertoarena/laravel-truss
Laravel Truss scans your live database schema and renders it as a scrollable, zoomable ER diagram inside your app. Structure only, never row data. Focus mode, searchable tables, themes, and export.
truss:doctor produces deterministic, stable-coded findings (TRUSS-IDX-001, missing primary keys, unindexed foreign keys, duplicate indexes, money-as-float). That converts "our schema is a mess" into a sized, enumerable backlog you can scope into a hardening sprint and re-measure afterwards.truss:export --check fails the build when the committed schema artifact drifts. That is a policy decision, not a technical one: do schema changes require a refreshed committed docs/schema.dbml? Truss makes the policy cheap to enforce.--format=llm, --compact, --focus, annotations, and the optional read-only MCP server give coding agents real structure as grounding context. The product decision is whether to standardise schema-context injection across agent workflows (one pipeline, one source of truth) rather than letting each engineer paste ad-hoc DDL into a prompt./truss on staging lets support engineers and new hires answer "how do these tables connect" without a DB client, prod credentials, or a senior engineer's time — a direct lever on time-to-first-PR and ticket triage latency.--dev) versus gated staging/production is a real decision with an install-type consequence: dev dependencies never reach composer install --no-dev builds, so /truss 404s in production by construction.Adopt when most of these hold:
viewTruss gate.Look elsewhere when:
config/database.php; hundreds of per-tenant databases are not the target shape.For executives — one paragraph. Truss is a free, MIT-licensed Laravel package that renders our live database structure as an interactive diagram inside the app, and exports that structure in standard formats. It replaces manual diagram upkeep and gives us three things we currently pay for in engineer hours: faster onboarding and support triage, a measurable schema-health backlog, and a CI check that stops undocumented schema drift. It also gives our AI coding tools accurate, current schema context, which reduces hallucinated columns and the review cycles they cause. No SaaS contract, no data leaves our infrastructure, no row data is ever read.
For engineering — the short version. composer require albertoarena/laravel-truss --dev, visit /truss. Auto-discovered, nothing to publish, local-environment-only by default. Mermaid and fonts are vendored, so it works offline and under a strict CSP. The snapshot is cached and rebuilt after migrations. Beyond the diagram: truss:doctor for structural linting with exit codes and presets suitable for CI, truss:export for deterministic DBML/JSON/CSV/Markdown/Mermaid/LLM output with a --check drift gate, and a Truss facade with an immutable builder if we want the same output programmatically. Command, facade, and dashboard share one pipeline, so the bytes match.
Risk read to state plainly. Early-stage, single-maintainer package with a small community and no downstream dependents — real bus-factor exposure. Mitigations are structural: MIT license, self-contained with no network calls, dev-dependency by default, and it only touches schema metadata. Exit cost is a composer remove and deleting a config file. Recommend a scoped pilot (one repo, local + gated staging) with the doctor rules wired into CI as a non-blocking warning first; promote to blocking once the existing findings are triaged.
How can I help you explore Laravel packages today?