Laravel Truss is a package by Alberto Arena that draws your database structure as a zoomable entity-relationship diagram in the browser. It reads structure only — tables, columns, keys and indexes — and never queries row data, so there is no need to point an external GUI client at the database or regenerate a static diagram after every migration. The diagram is rendered with vendored Mermaid assets.

Visiting /truss opens a map-style canvas you can pan and zoom. Clicking a table activates Focus Mode, which highlights that table and its foreign-key neighbours while dimming the rest; a Depth control widens the ring one hop at a time. Tables can be filtered by name, column labels toggled between native SQL types and Laravel-style types, and light or dark blueprint themes selected. Multiple database connections are configured in config/truss.php using the connection names from config/database.php, each with optional excluded_tables; a toolbar picker then switches connections, re-rendering the schema and keeping the selection in the URL for bookmarking. Each connection is introspected against its own database, so nothing leaks between schemas. Because fonts and libraries ship with the package, the dashboard works offline and under strict Content Security Policy rules.

For migration tracking, Truss caches a structural snapshot after migrations run and compares the current database against it, surfacing added or dropped tables, column type changes, index adjustments and foreign key updates in a "Changes" panel and via php artisan truss:diff. A Schema Doctor runs deterministic checks flagging tables without primary keys, unindexed foreign key columns, duplicate indexes and risky data types, shown in a "Health" panel or run via php artisan truss:doctor — usable in CI pipelines.

Exports cover the diagram as PNG or SVG from the browser, and the structure as DBML, JSON, CSV, Mermaid or a Markdown data dictionary, either from the dashboard or with php artisan truss:export --format=dbml --output=docs/schema.dbml. Individual tables can be focused, copied or downloaded as JSON, CSV or Markdown. Output is deterministic, and a --check flag regenerates the export and fails CI if it differs from the committed file.

Truss requires PHP 8.3+ and Laravel 12+. Install with composer require albertoarena/laravel-truss --dev for local use; the /truss route is local-only by default but can be enabled in staging or production behind an authorisation gate when installed as a regular dependency. Documentation lives at trussphp.com and on GitHub.