Installation
composer require albertoarena/filament-trussLaravel Truss comes with it as a regular dependency, so there is nothing else to install and no asset to publish.
Register the plugin
use AlbertoArena\FilamentTruss\FilamentTrussPlugin;use Filament\Panel;use Filament\PanelProvider;
class AdminPanelProvider extends PanelProvider{ public function panel(Panel $panel): Panel { return $panel // ... ->plugin(FilamentTrussPlugin::make()); }}The page appears in the panel navigation as Database schema, at /database-schema under your panel’s path. There is nothing to configure for the diagram itself: it follows Truss’s config and the panel’s theme.
Who can see the page
A Filament page never passes through Truss’s middleware, so the plugin asks the same questions itself. The page is visible exactly when the Truss dashboard would be visible to the same user, and in the same order.
-
truss.enabled, which defaults to on inlocaland off everywhere else. SetTRUSS_ENABLED=trueto run it anywhere else. -
In
local, that is all. Truss leaves the dashboard open there and so does this page. -
Everywhere else, the
viewTrussgate. Truss ships a default that admits the emails inTRUSS_ALLOWED_EMAILS, and an application can define its own instead:Gate::define('viewTruss', fn ($user) => $user->isAdmin());
Being allowed into the panel is not the same as being allowed to read the database structure, and the plugin never treats it as such. Both switches are Truss’s, so a viewer who can see the Truss dashboard can see this page, and a viewer who cannot, cannot.
See Authorization for how the gate works and what to put in it.