Repository navigation
Laravel Truss v1.14: the whole diagram as one file #80
albertoarena
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
php artisan truss:export --format=html --output=schema.htmlwrites your whole dashboard into one file: the ER diagram (ERD), the filter, the focus picker, the structure health panel, zoom and pan. Double-click it and it opens. No server, no network, no database, and whoever opens it needs neither Truss nor access to your application.The schema review that used to need a screen share becomes an attachment on a pull request.
If you are coming from v1.10 and you run
truss:doctorin CI, read "Since v1.10" below before you upgrade. A rule added in v1.11.0 runs as an error under the default preset, so a build can go red on a schema nobody touched.What is in the file, and what it costs
The file is around 3.6 MB because it carries everything it needs: your structure, the stylesheet, the fonts and a copy of Mermaid. That size is the promise rather than the cost. Nothing is fetched when somebody opens it.
If you would rather have kilobytes,
--mermaid=cdnleaves Mermaid out and loads it from a URL instead. The file then needs a network to open. It usestruss.diagram.mermaid_urlwhen you have set one, so an install that already self-hosts Mermaid points the exported file at its own copy rather than at a public CDN.--outputis required for this format alone. Several megabytes of minified JavaScript is not something to discover in a terminal or a CI log.The structure health findings travel in the file, so whoever opens it sees the same flags you do. If you commit an export, know that a Truss upgrade changing a doctor rule will change the file, so
--checkcan report drift on an upgrade rather than on a schema change. The generated-at timestamp and the diff against your baseline are left out for the opposite reason: a committed file should not report drift on a day when nothing about your schema changed.htmlis a command-line format only. The gated export route and the MCP tools still serve the six text formats, because a document carrying its own fonts and scripts is not a useful answer to aGETor to a model.The schema export guide covers the rest, including what to weigh before committing one.
Since v1.10
This is the first announcement here since v1.10, so here is what landed in between.
v1.11.0 added
TRUSS-INT-010, which finds a foreign key pointing at the wrong table: a single-column*_idkey referencing one table while a table named after the column exists and is a different one. It is high confidence and an error, so it runs under the defaultrecommendedpreset. That is the one to know about before upgrading, because it can turntruss:doctor --fail-on=errorred on a schema you have not changed. Aliases likeparent_transaction_idare not flagged, since no table carries that name, and morph targets and composite keys are skipped.v1.12.0 added
Truss::payload(), which returns the array the dashboard runs on, in process and with no HTTP request. The diagram can also run on a payload embedded in the page, so no schema endpoint is requested or needed. That is groundwork rather than a feature, and it is what made the Filament plugin possible.v1.13.0 made the dashboard say what it hides. The footer reads
32 of 40 tableswhenexcluded_tableshides some, the payload reportsexcluded.count, and a Show hidden tables toggle draws them muted. New configreveal_excludeddecides whether they reach the browser at all: on in local, off everywhere else.truss:shownow filters the same way, which its documentation always said it did.v1.13.1 made the toolbar measure itself instead of the window, so the Filter field no longer collapses when the dashboard is embedded in something narrower, such as a Filament panel.
Full notes: https://github.com/albertoarena/laravel-truss/releases/tag/v1.14.0
Structure only, never data.
All reactions