PHP Classes

File: CHANGELOG.md

Recommend this page to a friend!
  Packages of Alberto Arena   Laravel Truss   CHANGELOG.md   Download  
File: CHANGELOG.md
Role: Auxiliary data
Content type: text/markdown
Description: Auxiliary data
Class: Laravel Truss
View a diagram of a Laravel application models
Author: By
Last change: chore: release v1.6.1

Complete the v1.6.0 theming feature: a custom palette now re-skins the whole
diagram (relationship lines and labels, rows, inputs, label backdrop, and the
grid), not just the tables.
fix: derive the background grid from the accent colour (#24)

Complete the diagram theming: the faint background grid was still on the
shipped blue on a custom palette. Derive it as a translucent tint of the
accent colour (rgba at the grid's usual low opacities), so it follows a
custom accent. Applies when the accent is a hex value, from which the
channels can be read; an rgb()/hsl()/keyword accent leaves the grid on the
default. No new knob.
fix: theme the whole diagram, not just the tables (#23)

A custom truss.theme palette left the diagram's connective chrome on the
shipped Blueprint colours: the relationship lines and labels, the label
backdrop, and, in dark mode, the odd table rows and input backgrounds. So a
themed diagram showed blue lines and mismatched rows on an otherwise warm or
high-contrast palette, a half-themed result.

Extend the knob to token map so the existing knobs also drive those tokens:
background -> edge-bg, surface -> row-odd and field, muted -> rel and edge.
No new knobs and no API change; a custom palette now re-skins the diagram
completely. Guarded by a regression test that asserts a custom theme leaves
none of those tokens at the default.
chore: release v1.6.0

Two backward-compatible features (CLI schema export and config-driven
theming) plus responsive toolbar and legend fixes. Removes the unused
truss.diagram.theme config key.
feat: theming and custom palettes (#22)

Let a host redefine the dashboard's colours and fonts from config to
match the app Truss is embedded in. A new truss.theme block exposes a
small set of semantic knobs (accent, background, surface, text, border,
and more) plus two font-family knobs; a ThemeStylesheet service maps each
onto the internal design tokens and emits only the ones set, so a handful
of values re-skins the whole dashboard, chrome and diagram, in both light
and dark, while everything else stays on the shipped default.

The overrides are delivered as a gated, same-origin stylesheet, so a
strict Content-Security-Policy still needs only style-src 'self' and a
default install makes no extra request. Values are validated against a
strict allow-list before they are written into the CSS response, so a
malformed or hostile value is dropped and degrades to the default rather
than breaking or injecting the sheet. Fonts are family names only. The
unused truss.diagram.theme key is removed in favour of truss.theme.
feat: schema export command for CI and tooling (#20)

Add `php artisan truss:export`, the command-line counterpart to the
dashboard export button, so a CI job, script, or tool can pull the
database structure without a human opening the diagram. It writes DBML,
JSON, CSV, a Markdown data dictionary, or Mermaid to stdout by default
or to a file with --output.

The output is deterministic (tables, foreign keys, and indexes are given
a canonical order, and nothing time-, version-, or host-dependent enters
it), so the same schema always produces the same bytes. That makes the
headline CI use case reliable: --check regenerates the export, compares
it against --output, writes nothing, and exits non-zero on drift, failing
a build when a committed schema file has gone stale.

A new src/Export/ layer holds one Generator per format plus a
SchemaExporter service that filters and orders the tables and dispatches
to the generator. The generators are ported from the browser versions in
resources/js; while both coexist they are pinned byte-for-byte to the
same golden fixtures, checked from both Pest and Vitest, so the CLI and
the dashboard download cannot drift. The export reuses the managed-
connection allow-list and the excluded_tables merge, and config
exclusions always win over --tables, so it never widens the structure
surface the dashboard already exposes. Structure only, no row data, no
network call, proven by a canary test that seeds a real row and asserts
it appears in no format.
fix: toolbar overflow and mobile legend placement (#21)

* fix: toolbar overflow on small desktop widths

With every toolbar control active (filter, focus, depth, type labels, and
the export, changes, health, legend, and theme buttons) and long table
names, the dashboard toolbar could grow wider than the viewport on a small
desktop. The bar is position:sticky, which pins only vertically, so the
overflow let a horizontal drag slide the whole header sideways and clip the
brand.

The secondary controls (focus, depth, type labels) already collapsed into
the more menu, but only below 560px, well under the width where the fully
featured bar stops fitting. Move that collapse to 1024px, comfortably above
the full toolbar's width so there is no overflow band, cap the focus and
connection selects so a long name cannot grow the bar without bound, and let
the search field shrink. The toolbar now always fits.

Covered by a new layout e2e fixture that loads the real stylesheet and the
real toolbar structure (unlike the JS interaction harness, which inlines its
own styles), asserting no horizontal overflow at desktop, small-desktop, and
narrow widths.

* fix: mobile legend placement, consistent with other overlays

On a phone the legend was styled as a full-width bottom sheet, while the
changes and health panels stayed top-right dropdowns, so the legend looked
misplaced and out of step with the rest. Drop the bottom-sheet override so
the legend keeps the same top-right dropdown placement as the other overlays
at every width.

Extends the toolbar layout e2e fixture with the legend and asserts, at a
phone width, that it is anchored just under the toolbar and is a dropdown
panel rather than a full-width bottom sheet.

* fix: align the legend vertically with the other overlays

A leftover tablet-width rule nudged only the legend to top:58px while the
changes and health panels sit at top:62px, so the legend rendered a few
pixels higher than the rest. Drop the override so all the overlays share the
same vertical offset. The layout e2e now asserts the legend top equals a
reference panel's top, not just that it is near the toolbar.
Date: 7 days ago
Size: 10,948 bytes
 

Contents

Class file image Download

Changelog

All notable changes to laravel-truss will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[Unreleased]

[1.6.1] - 2026-08-03

Fixed

  • Theming now re-skins the whole diagram, not just the tables. A custom `truss.theme` palette previously left the relationship lines and labels, the label backdrop, the background grid, and (in dark mode) the odd table rows and input backgrounds on the shipped Blueprint colours, so a themed diagram showed blue lines and mismatched rows. The `background`, `surface`, and `muted` knobs now also drive the label, row, and input tokens, and the background grid is derived as a faint tint of the `accent` colour, so a few knob values re-skin the diagram completely.

[1.6.0] - 2026-08-03

Added

  • Theming and custom palettes: match Truss to the app it is embedded in by defining your own colours and fonts from config under `truss.theme`. A small set of semantic knobs (`accent`, `background`, `surface`, `text`, `border`, and more) plus two font-family knobs re-skin the whole dashboard, chrome and diagram, in both light and dark; only the knobs you set are overridden, the rest stay on the default, so a handful of values is enough. Delivered as a same-origin stylesheet, so a strict Content-Security-Policy still needs only `style-src 'self'`, with no build step and no extra request on a default install. Each value is validated before it is emitted, so an invalid value falls back to the default rather than breaking the sheet.
  • Schema export from the command line: `php artisan truss:export` writes the database structure to DBML, JSON, CSV, a Markdown data dictionary, or Mermaid, for CI, tooling, and version control. The command-line counterpart to the dashboard export button, generated from PHP so it needs no browser. Writes to stdout by default (pipeable) or a file with `--output`, filters with `--tables` / `--exclude` (config `excluded_tables` always wins), targets a connection with `--connection`, and rebuilds first with `--fresh`. Output is deterministic (the same schema always produces the same bytes), so `--check` can fail the build when a committed export file has gone stale. Exit codes: `0` written or up to date, `1` `--check` found drift, `2` a usage or runtime error. Structure only, with no network call.

Removed

  • The unused `truss.diagram.theme` config key (it was wired to nothing). Theme selection now lives under the new `truss.theme` block.

Fixed

  • The dashboard toolbar no longer overflows the viewport on a small desktop. With every control active (filter, focus, depth, type labels, and the export, changes, health, legend, and theme buttons) and long table names, the bar could grow wider than the window; because it is sticky it pinned only vertically, so a horizontal drag slid the whole header sideways and clipped the brand. The secondary controls (focus, depth, type labels) now fold into the more menu below 1024px, the focus and connection selects are width capped, and the search field can shrink, so the toolbar always fits.
  • On a phone the legend now opens as a top-right dropdown, matching the changes and health panels, instead of a full-width bottom sheet, so all the toolbar overlays behave consistently.

[1.5.0] - 2026-07-30

Added

  • Schema doctor: `php artisan truss:doctor` (aliased `truss:check`) reviews the database structure for problems visible from structure alone, a table with no primary key, an unindexed foreign key, duplicate or redundant indexes, a foreign key type mismatch, money stored as a float, and more, and can fail CI. Deterministic and structure only, with no AI and no network call. Thirteen rules across integrity, index, and type categories, presets (recommended, strict, none), per-rule and per-category configuration, ignore patterns, a grouped console table (findings grouped per table, long messages wrapped) and JSON output, and exit codes for CI. Configured under `truss.doctor`.
  • Schema doctor in the dashboard: a "Health" panel lists the findings grouped by table, badges the tables that have findings on the diagram (coloured by worst severity), marks heuristic findings, and focuses a table when you click it. The toggle is an animated heart, the panel can be maximized for reading, the offending column is marked on the diagram itself (click it for the finding detail), and opening any dashboard overlay now closes the others. Tables with findings are flagged on the diagram at all times (toggle with `truss.doctor.flag_tables` / `TRUSS_DOCTOR_FLAG_TABLES`). It rides the existing schema endpoint and is toggled with `truss.doctor.dashboard` (`TRUSS_DOCTOR_DASHBOARD`).

[1.4.2] - 2026-07-29

Changed

  • The dashboard connection switcher label now reads "Connections" instead of "Conn".
  • The legend overlay anchors to the dashboard container rather than the viewport, so it stays correctly placed when the dashboard is embedded below other page chrome (an iframe, or an embed).

[1.4.1] - 2026-07-29

Changed

  • The dashboard toolbar and overlay labels (Filter, Focus, Legend, Export view, and the rest) now read in sentence case instead of all caps, matching the documentation site. Diff badges read "Added" / "Removed" / "Changed". Visual only, no behaviour change.

[1.4.0] - 2026-07-29

Added

  • Schema diff: see what changed since your last migration. After each migration Truss records the previous schema as a baseline and compares it against the current one. The dashboard gains a "Changes" panel that tints added and changed tables and lists every added, removed, or changed table, column, index, and foreign key, and a new `php artisan truss:diff` command prints the same diff in the terminal (handy in CI). Structure only, never row data. The baseline is a structure-only JSON file, the only thing Truss writes to disk, stored at `truss/baselines/{connection}.json` on the disk set by `truss.diff.disk`. Set `TRUSS_DIFF_ENABLED=false` to turn the feature off entirely so nothing is written to disk.

[1.3.2] - 2026-07-29

Changed

  • The dashboard toolbar now shows the lowercase `truss` wordmark in IBM Plex Mono, matching the documentation site and the refreshed brand. Visual only, no behaviour change.

[1.3.1] - 2026-07-28

Fixed

  • Schema introspection is now scoped to the connection's own database. On a server that hosts more than one database (a shared local MySQL, a PostgreSQL cluster), `truss:show`, `truss:rebuild`, and the diagram listed the tables of every database the connection could reach rather than just the application's own, which also made the snapshot build far slower and could collapse same-named tables from different databases into each other. The listing now resolves the current schema per driver: the database name on MySQL, the search-path schema on PostgreSQL, and `main` on SQLite. Structure only, as always. Thanks to @santos-sabanari for the thorough diagnosis and @m0shiurX for the fix.

[1.3.0] - 2026-07-27

Added

  • Data dictionary and DBML exports. The diagram export button now also saves the current selection as a Markdown data dictionary (one section per table, with columns, keys, indexes, and foreign keys, ready to paste into a README or wiki) or as a DBML file that opens in dbdiagram.io and other DBML tools. The per-table menu gains a Download Markdown option. Both are generated in the browser and contain structure only, never row data. DBML relationships are included only when both tables are in the current view, and the native type mapping is best-effort (types are passed through, quoted when needed).

[1.2.0] - 2026-07-24

Changed

  • Self-referential foreign keys (a column pointing back at its own table, such as `parent_id` on `categories`) are now marked with a `self-ref` note on the column instead of a looping relationship line, which Mermaid drew as a large sweeping curve. Keeps the diagram tidy while the hierarchy stays visible on the row. Ordinary relationships are unaffected.

[1.1.0] - 2026-07-23

Added

  • `truss:show` Artisan command: print the database structure as a terminal table (table, column count, foreign-key count), the text counterpart to the visual dashboard. Structure only.
  • `truss:open` Artisan command: open the dashboard in the default browser, honouring the configured route prefix and app URL.

[1.0.0] - 2026-07-23

First stable release. The API, config, and authorization model are considered stable and will follow semantic versioning from here.

Added

  • Diagram image export: an export button saves the whole current diagram (the current filter/focus selection) as a PNG or SVG. Fully client-side and dependency-free (no CDN, CSP-safe): labels are flattened to SVG text and the font is embedded, so the output is theme-matched and correct anywhere. Structure only.

[0.3.0] - 2026-07-23

Added

  • Per-table export/focus menu: click a table name in the diagram to focus (or unfocus) it, copy its structure as JSON, or download its structure as JSON or CSV. Exports are generated in the browser and contain structure only (columns, keys, indexes), never row data.

[0.2.0] - 2026-07-23

Added

  • Deep-linkable views: the current connection, filter, focus, depth, and type-label mode are reflected in the URL query string (for example `/truss?focus=projects`), updated live as you interact. On load the query string seeds the initial view, so a focused or filtered view can be bookmarked, shared, and reopened.

[0.1.0] - 2026-07-23

Added

  • Introspection layer: composite-first value objects (`Table`, `Column`, `Index`, `ForeignKey`), a `SchemaSerializer`, and a `SnapshotBuilder` that reads the live connection via Laravel's native schema introspection, with an in-memory SQLite replay fallback when no connection is reachable.
  • Caching: a per-connection `SchemaCacheRepository` respecting `cache.ttl`, a listener that rebuilds after migrations, and a `truss:rebuild` Artisan command.
  • HTTP layer: the dashboard page and a JSON schema endpoint behind the fixed `viewTruss` gate, with a production-gated authorization model (an email allow-list default gate, overridable per app), configurable auth-context middleware, and 404 on denial.
  • Frontend: a client-side ER diagram rendered with Mermaid, with focus mode (a table and its foreign-key neighbours, centred and highlighted), text filter, native/Laravel type labels, and clickable `enum`/`set` value popovers.
  • Map-style pan and zoom (drag, wheel, pinch) with a readable auto-fit floor and a Fit button.
  • A light and dark "blueprint" theme, a Node-triad brand mark, and a self-hosted, CDN-free asset pipeline (vendored Mermaid and IBM Plex Mono served from a gated package route).
  • Documentation site built with Astro and Starlight.