bugo/filament-er-diagram
最新稳定版本:0.2
Composer 安装命令:
composer require bugo/filament-er-diagram
包简介
Live ER diagram panel for FilamentPHP 5 — auto-detects Eloquent models and relationships
README 文档
README
A Filament 5 plugin that generates a live, interactive ER diagram directly inside your admin panel.
It auto-discovers all Eloquent models in a given directory, reads their database columns via Schema, detects relationships via Reflection, and renders an interactive force-directed graph powered by D3.js.
Features
- 🔍 Auto-discovers Eloquent models — no configuration needed for basic use
- 🔗 Detects
hasMany,hasOne,belongsTo,belongsToMany,morphMany,morphOneandThroughvariants - 🏷️ Shows table name, column names, types, PK and FK badges
- 🖱️ Draggable nodes, pan & zoom, click-to-highlight connected models
- 🔎 Real-time model search
- 💾 One-click export to SVG or PNG
- 🌙 Full dark mode support
- ⚙️ Fully configurable via fluent plugin API
Installation
composer require bugo/filament-er-diagram
Requires a custom Filament theme. Add the plugin's views to your theme's CSS source:
@source '../../../../vendor/bugo/filament-er-diagram/resources/**/*.blade.php';
Publish the config (optional):
php artisan vendor:publish --tag="filament-er-diagram-config"
Build the JS assets:
php artisan filament:assets
Usage
Register the plugin in your AdminPanelProvider:
use Bugo\FilamentErDiagram\ErDiagramPlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ ErDiagramPlugin::make(), ]); }
The panel now has an ER Diagram page under the Tools navigation group.
Customisation
ErDiagramPlugin::make() ->modelsPath('app/Domain/Models') // custom directory ->excludeModels([PersonalAccessToken::class]) ->withoutColumns() // hide column details ->withoutRelationshipLabels() // hide edge labels ->navigationGroup('Developer') ->navigationSort(10) ->navigationIcon('heroicon-o-table-cells'),
Artisan command
# Print a table summary php artisan er-diagram:generate --path=app/Models # Print clean JSON to stdout php artisan er-diagram:generate --format=json --path=app/Models # Save JSON to file php artisan er-diagram:generate --format=json --output=er-diagram.json # Exclude specific models php artisan er-diagram:generate --exclude=App\\Models\\PersonalAccessToken
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-29