albertoarena / laravel-truss
A live database structure viewer for Laravel. Renders your schema (never data) as a scrollable, zoomable ER diagram.
Requires
- php: ^8.3
- illuminate/contracts: ^12.0 || ^13.0
- illuminate/support: ^12.0 || ^13.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- laravel/pint: ^1.18
- orchestra/testbench: ^10.0 || ^11.0
- pestphp/pest: ^3.5
README
Laravel Truss is a live database structure viewer. It scans your live schema and renders it as a scrollable, zoomable ER diagram right inside your app, so you can see how the tables actually connect without opening a DB client. It reads structure only (tables, columns, keys, indexes); row data is never queried or exposed.
Features
- Live ER diagram of your database, rendered with Mermaid.
- Focus mode: a table and its foreign-key neighbours, centred and highlighted.
- Filter by table name, and toggle native types against Laravel-style labels.
- Map-style pan and zoom, with auto-fit and a Fit button.
- Light and dark "blueprint" theme.
- Self-contained: Mermaid and fonts are vendored and served from the package, so it works offline and under a strict Content-Security-Policy (no CDN).
- Cached snapshot, rebuilt automatically after migrations.
Documentation
Full documentation is at albertoarena.github.io/laravel-truss.
Installation
For local use, install Truss as a dev dependency:
composer require albertoarena/laravel-truss --dev
To run Truss gated on staging or production, install it as a regular dependency instead. Dev dependencies are excluded from composer install --no-dev builds, so a --dev install never reaches a production deploy and /truss returns 404 there:
composer require albertoarena/laravel-truss
Requires PHP 8.3+ and Laravel 12+. The service provider is auto-discovered, so there is nothing to publish to get started.
Quick start
By default Truss is enabled in the local environment only. Start your app and visit:
/truss
To use Truss in a non-local environment you must both enable it and authorize the viewers. See Authorization.
Security
Truss exposes structure only and never queries row data. Access is protected by the fixed viewTruss gate. If you discover a security issue, please email arena.alberto@gmail.com rather than opening a public issue.
Contributing
Contributions are welcome. Feel free to fork, improve, and open a pull request.
License
The MIT License (MIT). See LICENSE.