PHPackages                             bugo/filament-er-diagram - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. bugo/filament-er-diagram

ActiveLibrary[Database &amp; ORM](/categories/database)

bugo/filament-er-diagram
========================

Live ER diagram panel for FilamentPHP 5 — auto-detects Eloquent models and relationships

0.2(1mo ago)00MITPHPPHP ^8.2CI passing

Since Apr 29Pushed 1mo agoCompare

[ Source](https://github.com/dragomano/filament-er-diagram)[ Packagist](https://packagist.org/packages/bugo/filament-er-diagram)[ RSS](/packages/bugo-filament-er-diagram/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (7)Versions (3)Used By (0)

Filament ER Diagram
===================

[](#filament-er-diagram)

[![PHP](https://camo.githubusercontent.com/7bffcab80be9e1d83d7ec1e72f01342ea9ea17a26347f9b34a8d4a5ae8b58c48/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545382e322d626c75652e7376673f7374796c653d666c6174)](https://camo.githubusercontent.com/7bffcab80be9e1d83d7ec1e72f01342ea9ea17a26347f9b34a8d4a5ae8b58c48/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545382e322d626c75652e7376673f7374796c653d666c6174)[![Coverage Status](https://camo.githubusercontent.com/e9df8d72214e4fa122326135cb71882e3a7c56e898d20ec776f7f176b8ae01b7/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f647261676f6d616e6f2f66696c616d656e742d65722d6469616772616d2f62616467652e7376673f6272616e63683d6d61696e)](https://coveralls.io/github/dragomano/filament-er-diagram?branch=main)

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.

---

[![Image](https://private-user-images.githubusercontent.com/229402/585442151-4b095a40-21a0-4c92-9d0d-98b2e18c1f36.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODA1MjA4NTksIm5iZiI6MTc4MDUyMDU1OSwicGF0aCI6Ii8yMjk0MDIvNTg1NDQyMTUxLTRiMDk1YTQwLTIxYTAtNGM5Mi05ZDBkLTk4YjJlMThjMWYzNi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNjAzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDYwM1QyMTAyMzlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yMDM5YTc3OTI3NzJlM2UyZjQxOWIzYTY2NTZkMTU0Y2NmMDQ1ZWFiMjE0YWRiYzNjMzE4OTVlZGIyMGFiOGVjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZyZXNwb25zZS1jb250ZW50LXR5cGU9aW1hZ2UlMkZwbmcifQ.7x1WiLt2bf6bhDUleHdIRHBXhu6D3VN7N1eqCLmg3F8)](https://private-user-images.githubusercontent.com/229402/585442151-4b095a40-21a0-4c92-9d0d-98b2e18c1f36.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODA1MjA4NTksIm5iZiI6MTc4MDUyMDU1OSwicGF0aCI6Ii8yMjk0MDIvNTg1NDQyMTUxLTRiMDk1YTQwLTIxYTAtNGM5Mi05ZDBkLTk4YjJlMThjMWYzNi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNjAzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDYwM1QyMTAyMzlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yMDM5YTc3OTI3NzJlM2UyZjQxOWIzYTY2NTZkMTU0Y2NmMDQ1ZWFiMjE0YWRiYzNjMzE4OTVlZGIyMGFiOGVjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZyZXNwb25zZS1jb250ZW50LXR5cGU9aW1hZ2UlMkZwbmcifQ.7x1WiLt2bf6bhDUleHdIRHBXhu6D3VN7N1eqCLmg3F8)Features
--------

[](#features)

- 🔍 Auto-discovers Eloquent models — no configuration needed for basic use
- 🔗 Detects `hasMany`, `hasOne`, `belongsTo`, `belongsToMany`, `morphMany`, `morphOne` and `Through` variants
- 🏷️ Shows table name, column names, types, PK and FK badges
- 🖱️ Draggable nodes, pan &amp; 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
------------

[](#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
-----

[](#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

[](#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

[](#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
```

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance91

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

41d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ef0dd570abdd5696bf5ba391bcd00ed0bb0ac5d1a5654785e8f204d548ddfc0?d=identicon)[Bugo](/maintainers/Bugo)

---

Top Contributors

[![dragomano](https://avatars.githubusercontent.com/u/229402?v=4)](https://github.com/dragomano "dragomano (15 commits)")

---

Tags

er-diagramfilamentfilament-pluginlaravellaraveleloquentfilamentfilament-pluginer diagram

###  Code Quality

TestsPest

Static AnalysisRector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/bugo-filament-er-diagram/health.svg)

```
[![Health](https://phpackages.com/badges/bugo-filament-er-diagram/health.svg)](https://phpackages.com/packages/bugo-filament-er-diagram)
```

###  Alternatives

[relaticle/custom-fields

User Defined Custom Fields for Laravel Filament

16345.8k](/packages/relaticle-custom-fields)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3913.7k](/packages/rawilk-profile-filament-plugin)[croustibat/filament-jobs-monitor

Background Jobs monitoring like Horizon for all drivers for FilamentPHP

264298.4k8](/packages/croustibat-filament-jobs-monitor)[stephenjude/filament-jetstream

A Laravel starter kit built with Filament inspired by Jetstream.

17758.9k2](/packages/stephenjude-filament-jetstream)[stephenjude/filament-two-factor-authentication

Filament Two Factor Authentication: Google 2FA + Passkey Authentication

84192.9k7](/packages/stephenjude-filament-two-factor-authentication)[marcelweidum/filament-passkeys

Use passkeys in your filamentphp app

6643.3k](/packages/marcelweidum-filament-passkeys)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
