PHPackages                             northwestern-sysdev/er-diagram-tool - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. northwestern-sysdev/er-diagram-tool

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

northwestern-sysdev/er-diagram-tool
===================================

Automatically generate entity relationship diagrams for a Laravel application

v1.1.0(1y ago)047.8k↑178.8%MITBladePHP ^8.2

Since May 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/NIT-Administrative-Systems/er-diagram-tool)[ Packagist](https://packagist.org/packages/northwestern-sysdev/er-diagram-tool)[ RSS](/packages/northwestern-sysdev-er-diagram-tool/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependencies (7)Versions (6)Used By (0)

Entity Relationship Diagram Tool for Laravel [![Coverage Status](https://camo.githubusercontent.com/f9a49151e938ffc58018c0bdf1177db4d23d408080f240c57653855b93820ba6/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4e49542d41646d696e6973747261746976652d53797374656d732f65722d6469616772616d2d746f6f6c2f62616467652e737667)](https://coveralls.io/github/NIT-Administrative-Systems/er-diagram-tool)
===========================================================================================================================================================================================================================================================================================================================================================================================================================

[](#entity-relationship-diagram-tool-for-laravel-)

Automatically generate interactive entity relationship diagram for models &amp; their relationships in Laravel and emit a static HTML file for use in a VuePress site.

This package is a heavily-customized fork from [kevincobain2000/laravel-erd](https://github.com/kevincobain2000/laravel-erd) meant for use in some very specific circumstances. If you're not part of @NIT-Administrative-Systems, you should probably check out the original package instead!

The changes include:

- Adding ribbons to models in the diagram with PHP attributes on the model class
- Different default settings for goJS to render huge diagrams efficiently
- Different default settings for discovering models in `App\Domains\\Models` namespaces

Installation
------------

[](#installation)

You can install the package via composer.

```
composer require northwestern-sysdev/er-diagram-tool --dev
```

Usage
-----

[](#usage)

You can generate a static HTML file with the artisan command:

```
php artisan erd:generate
```

This will be placed in `docs/.vuepress/public/erd`, or whatever path you have configured in `config/laravel-erd.php`.

Using Ribbons
-------------

[](#using-ribbons)

Enabling ribbon support is done by registering a function to get ribbons.

First, create an attribute with some properties you want to include in the ribbon:

```
#[Attribute(Attribute::TARGET_CLASS)]
class LookupAttr
{
    public function __construct(
        public readonly string $source,
    ) {
        //
    }
}
```

Next, register a callback in a provider's

```
class AppServiceProvider extends ServiceProvider {
    public function boot(): void
    {
        /** @var ModelRibbonAdapter $adapter */
        $adapter = resolve(ModelRibbonAdapter::class);

        \Kevincobain2000\LaravelERD\LaravelERDServiceProvider::setRibbonClosure($adapter->callback());
    }

    private function ribbonCallback(): Closure
    {
        return function (Model $model) {
            $reflection = new ReflectionClass($model);
            $attributes = collect($reflection->getAttributes())
                ->map->newInstance()
                ->filter(fn (object $attrObj) => $attrObj instanceof LookupAttr);

            return $attributes
                ->map(function (LookupAttr $attr) {
                    return new \Kevincobain2000\LaravelERD\Diagram\Ribbon(
                        text: $attribute->source,
                        bgColour: '#FFE342',
                        textColour: 'black',
                    );
                })
                ->first();
        };
    }
}
```

And then use the attribute on some models:

```
#[LookupAttr('Student System')]
class DegreeType extends Model
{
    // . . .
}
```

This will pick them up and add a ribbon with the "Student System" text on it, indicating the table is populated from the student system's degree types.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance40

Moderate activity, may be stable

Popularity29

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 56.8% 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 ~166 days

Total

5

Last Release

493d ago

PHP version history (2 changes)v1.0.0PHP ^8.1

v1.1.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/3d4678c8051de43c86bddf6aec2c570d07175ac1011296dd25b8e6e97a0af34b?d=identicon)[northwestern-sysdev](/maintainers/northwestern-sysdev)

---

Top Contributors

[![kevincobain2000](https://avatars.githubusercontent.com/u/629055?v=4)](https://github.com/kevincobain2000 "kevincobain2000 (21 commits)")[![nie7321](https://avatars.githubusercontent.com/u/27235866?v=4)](https://github.com/nie7321 "nie7321 (12 commits)")[![dfsmania](https://avatars.githubusercontent.com/u/63609705?v=4)](https://github.com/dfsmania "dfsmania (1 commits)")[![dxnter](https://avatars.githubusercontent.com/u/17434202?v=4)](https://github.com/dxnter "dxnter (1 commits)")[![jaffarhussain1011](https://avatars.githubusercontent.com/u/3069478?v=4)](https://github.com/jaffarhussain1011 "jaffarhussain1011 (1 commits)")[![koshuang](https://avatars.githubusercontent.com/u/1978357?v=4)](https://github.com/koshuang "koshuang (1 commits)")

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/northwestern-sysdev-er-diagram-tool/health.svg)

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

###  Alternatives

[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329530.5k29](/packages/codewithdennis-filament-select-tree)[stephenjude/filament-feature-flags

Filament implementation of feature flags and segmentation with Laravel Pennant.

122177.8k1](/packages/stephenjude-filament-feature-flags)[wsmallnews/filament-nestedset

Filament nestedset tree builder powered by kalnoy/nestedset with Filament v4 and v5 support

197.8k17](/packages/wsmallnews-filament-nestedset)[tapp/filament-form-builder

User facing form builder using Filament components

132.4k3](/packages/tapp-filament-form-builder)

PHPackages © 2026

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