PHPackages                             alltrons/laravel-erd-modules - 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. alltrons/laravel-erd-modules

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

alltrons/laravel-erd-modules
============================

A tool to automatically generate interactive ERD relationships in Models for Laravel, upgrated to work for modules

1.8(4y ago)050MITPHPPHP ^7.3|^7.4|^8.0

Since Jul 24Pushed 4y agoCompare

[ Source](https://github.com/Alltrons/laravel-erd-alltrons)[ Packagist](https://packagist.org/packages/alltrons/laravel-erd-modules)[ Docs](https://alltrons.com/)[ RSS](/packages/alltrons-laravel-erd-modules/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (7)Versions (9)Used By (0)

Laravel ERD Generator
=====================

[](#laravel-erd-generator)

Automatically generate interactive ERD from Models relationships in Laravel.

- This package provides a CLI to automatically generate interactive ERD by looking into relationships setup inside Models.
- The tool's interface is available to get JSON data of relationships and table schema from Models to be used by visual charts libraries of your choice such as d3.js etc
- Output is an interactive ERD (Entity Relation Diagram) powered by HTML and JS (GOJS).

LangLinkDetails[Medium Article](https://medium.com/web-developer/laravel-automatically-generate-interactive-erd-from-eloquent-relations-83fe65440716)Demo[Online Demo](https://kevincobain2000.github.io/laravel-blog/erd/)Requirements
------------

[](#requirements)

LangVersionPHP7.4 or 8.0Laravel6.\* or 8.\*Installation
------------

[](#installation)

You can install the package via composer:

```
composer require kevincobain2000/laravel-erd --dev
```

You can publish the config file with:

```
php artisan vendor:publish --provider="Kevincobain2000\LaravelERD\LaravelERDServiceProvider"
```

Usage
-----

[](#usage)

You can access the ERD in `localhost:3000/erd`

or generate a static HTML

```
php artisan erd:generate
```

ERD HTML is generated inside `docs/`.

### Sample

[](#sample)

#### Screenshot

[](#screenshot)

[![Image](https://camo.githubusercontent.com/65a3c0257db105759613ea2edce66c146e7f6233d2205fb10379cee52fa2bd97/68747470733a2f2f692e696d6775722e636f6d2f74596b314375432e706e67)](https://camo.githubusercontent.com/65a3c0257db105759613ea2edce66c146e7f6233d2205fb10379cee52fa2bd97/68747470733a2f2f692e696d6775722e636f6d2f74596b314375432e706e67)

#### Get JSON output

[](#get-json-output)

```
use Kevincobain2000\LaravelERD\LaravelERD;

$modelsPath = base_path('app/Models');

$laravelERD = new LaravelERD();
$linkDataArray = $laravelERD->getLinkDataArray($modelsPath);
$nodeDataArray = $laravelERD->getNodeDataArray($modelsPath);
$erdData = json_encode(
    [
        "link_data" => $linkDataArray,
        "node_data" => $nodeDataArray,
    ],
    JSON_PRETTY_PRINT
);
var_dump($erdData);
```

Sample JSON output

```
{
    "link_data": [
        {
            "from": "comments",
            "to": "users",
            "fromText": "1..1\nBT",
            "toText": "",
            "fromPort": "author_id",
            "toPort": "id",
            "type": "BelongsTo"
        },
        {
            "from": "comments",
            "to": "posts",
            "fromText": "1..1\nBT",
            "toText": "",
            "fromPort": "post_id",
            "toPort": "id",
            "type": "BelongsTo"
        },
        ...
        ...
    ],
    "node_data": [
        {
            "key": "comments",
            "schema": [
                {
                    "name": "id",
                    "isKey": true,
                    "figure": "Hexagon",
                    "color": "#be4b15",
                    "info": "integer"
                },
                {
                    "name": "author_id",
                    "isKey": false,
                    "figure": "Decision",
                    "color": "#6ea5f8",
                    "info": "integer"
                },
                ...
                ...
        }
        ...
    ]
```

Testing
-------

[](#testing)

```
./vendor/bin/phpunit
```

Changelog
---------

[](#changelog)

- Initial Release - POC

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 59.5% 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 ~37 days

Total

8

Last Release

1487d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e9f480bd0c3a4ec985549ac27204027717125bf300dd023c12c9c3f1312e8568?d=identicon)[EuEric](/maintainers/EuEric)

---

Top Contributors

[![kevincobain2000](https://avatars.githubusercontent.com/u/629055?v=4)](https://github.com/kevincobain2000 "kevincobain2000 (22 commits)")[![EuEric](https://avatars.githubusercontent.com/u/42584094?v=4)](https://github.com/EuEric "EuEric (11 commits)")[![dfsmania](https://avatars.githubusercontent.com/u/63609705?v=4)](https://github.com/dfsmania "dfsmania (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)")[![nie7321](https://avatars.githubusercontent.com/u/27235866?v=4)](https://github.com/nie7321 "nie7321 (1 commits)")

---

Tags

laravel-erdlaravel erd generator modules

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/alltrons-laravel-erd-modules/health.svg)

```
[![Health](https://phpackages.com/badges/alltrons-laravel-erd-modules/health.svg)](https://phpackages.com/packages/alltrons-laravel-erd-modules)
```

###  Alternatives

[kevincobain2000/laravel-erd

A tool to automatically generate interactive ERD relationships in Models for Laravel

155265.9k](/packages/kevincobain2000-laravel-erd)[guava/calendar

Adds support for vkurko/calendar to Filament PHP.

298241.0k3](/packages/guava-calendar)[tonysm/rich-text-laravel

Integrates Trix content with Laravel

46577.8k1](/packages/tonysm-rich-text-laravel)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[spatie/laravel-screenshot

Take screenshots of web pages in Laravel apps

7615.9k2](/packages/spatie-laravel-screenshot)[joaopaulolndev/filament-world-clock

Show hours around the world by timezone

3111.9k](/packages/joaopaulolndev-filament-world-clock)

PHPackages © 2026

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