PHPackages                             cierrateam/laravel-er-diagram-generator - 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. cierrateam/laravel-er-diagram-generator

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

cierrateam/laravel-er-diagram-generator
=======================================

Generate ER diagrams from your Laravel models.

v9(3y ago)041MITPHPPHP ^7.1|^8.0

Since Sep 9Pushed 3y agoCompare

[ Source](https://github.com/cierrateam/laravel-er-diagram-generator)[ Packagist](https://packagist.org/packages/cierrateam/laravel-er-diagram-generator)[ Docs](https://github.com/cierrateam/laravel-er-diagram-generator)[ RSS](/packages/cierrateam-laravel-er-diagram-generator/feed)WikiDiscussions master Synced today

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

Laravel ER Diagram Generator
============================

[](#laravel-er-diagram-generator)

[![Latest Version on Packagist](https://camo.githubusercontent.com/aba754cf1f87da2bbce7797e1a8f6f36d3a5a4c6a49ec52df2adfb65597f2ed6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6369657272617465616d2f6c61726176656c2d65722d6469616772616d2d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cierrateam/laravel-er-diagram-generator)[![Build Status](https://camo.githubusercontent.com/5216d2b3b1bfaa8d4387bd870977afeed026906a879e02d720c95c97fc7796e6/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6369657272617465616d2f6c61726176656c2d65722d6469616772616d2d67656e657261746f722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/cierrateam/laravel-er-diagram-generator)[![Quality Score](https://camo.githubusercontent.com/a74091669aca5127bdcfb70bda43d05a0c4d8776b5e3340b4df1a75e7e481654/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6369657272617465616d2f6c61726176656c2d65722d6469616772616d2d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/cierrateam/laravel-er-diagram-generator)[![Total Downloads](https://camo.githubusercontent.com/69c8977fb9a0c078461ac3d79edaca1f99701221bf5e92483efe447c1f1d49fe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6369657272617465616d2f6c61726176656c2d65722d6469616772616d2d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cierrateam/laravel-er-diagram-generator)

This package lets you generate entity relation diagrams by inspecting the relationships defined in your model files. It is highly customizable. Behind the scenes, it uses [GraphViz](https://www.graphviz.org) to generate the graph.

> If you want to learn how to create reusable PHP packages yourself, take a look at my upcoming [PHP Package Development](https://phppackagedevelopment.com) video course.

Prerequisites
-------------

[](#prerequisites)

The minimum required PHP version is 7.1.0 - compatible to PHP 8.0

Requirements
------------

[](#requirements)

This package requires the `graphviz` tool.

You can install Graphviz on MacOS via homebrew:

```
brew install graphviz
```

Or, if you are using Homestead:

```
sudo apt-get install graphviz
```

To install Graphviz on Windows, download it from the [official website](https://graphviz.gitlab.io/_pages/Download/Download_windows.html).

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

[](#installation)

You can install the package via composer:

```
composer require cierrateam/laravel-er-diagram-generator --dev
```

If you are using Laravel 5.5+, the package will automatically register the service provider for you.

If you are using Lumen, you will need to add the following to `bootstrap\app.php`:

```
\\ Register Service Providers
$app->register(Cierra\ErdGenerator\ErdGeneratorServiceProvider::class);
```

Usage
-----

[](#usage)

By default, the package will automatically detect all models in your `app` directory that extend the Eloquent Model class. If you would like you explicitly define where your models are located, you can publish the configuration file using the following command.

```
php artisan vendor:publish --provider=Cierra\\ErdGenerator\\ErdGeneratorServiceProvider
```

If you're using Lumen and you want to customize the config, you'll need to copy the config file from the vendor directory:

```
cp ./vendor/cierrateam/laravel-er-diagram-generator/config/config.php config/erd-generator.php
```

Generating Diagrams
-------------------

[](#generating-diagrams)

You can generate entity relation diagrams using the provided artisan command:

```
php artisan generate:erd
```

This will generate a file called `graph.png`.

You can also specify a custom filename:

```
php artisan generate:erd output.png
```

Or use one of the other [output formats](https://www.graphviz.org/doc/info/output.html), like SVG:

```
php artisan generate:erd output.svg --format=svg
```

Customization
-------------

[](#customization)

Please take a look at the published `erd-generator.php` configuration file for all available customization options.

Examples
--------

[](#examples)

Here are some examples taken from the [Laravel.io](https://laravel.io) codebase.

[![Using Database Schema](https://camo.githubusercontent.com/f031f555abbcc3e745f74b9a7f77e1ea6972103fe6ac52f838c40cbdcb6c5d1a/68747470733a2f2f6265796f6e64636f2e64652f6769746875622f6572642d67656e657261746f722f736368656d612e706e67)](https://camo.githubusercontent.com/f031f555abbcc3e745f74b9a7f77e1ea6972103fe6ac52f838c40cbdcb6c5d1a/68747470733a2f2f6265796f6e64636f2e64652f6769746875622f6572642d67656e657261746f722f736368656d612e706e67)

[![Customized](https://camo.githubusercontent.com/dbbc243b54022f30a5eebd726e513c55cdd721f3ec8fcd193d9fb6f94851de56/68747470733a2f2f6265796f6e64636f2e64652f6769746875622f6572642d67656e657261746f722f637573746f6d697a65642e706e67)](https://camo.githubusercontent.com/dbbc243b54022f30a5eebd726e513c55cdd721f3ec8fcd193d9fb6f94851de56/68747470733a2f2f6265796f6e64636f2e64652f6769746875622f6572642d67656e657261746f722f637573746f6d697a65642e706e67)

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Marcel Pociot](https://github.com/mpociot)
- [Vittorio Emmermann](https://github.com/vittoriodev) for forking
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50.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

Unknown

Total

1

Last Release

1393d ago

### Community

Maintainers

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

---

Top Contributors

[![mpociot](https://avatars.githubusercontent.com/u/804684?v=4)](https://github.com/mpociot "mpociot (31 commits)")[![vittoriodev](https://avatars.githubusercontent.com/u/24706440?v=4)](https://github.com/vittoriodev "vittoriodev (12 commits)")[![diogogomeswww](https://avatars.githubusercontent.com/u/11543163?v=4)](https://github.com/diogogomeswww "diogogomeswww (5 commits)")[![daniel-werner](https://avatars.githubusercontent.com/u/38726367?v=4)](https://github.com/daniel-werner "daniel-werner (2 commits)")[![ThibaudDauce](https://avatars.githubusercontent.com/u/1770543?v=4)](https://github.com/ThibaudDauce "ThibaudDauce (2 commits)")[![iforwms](https://avatars.githubusercontent.com/u/10304616?v=4)](https://github.com/iforwms "iforwms (1 commits)")[![joe-pritchard](https://avatars.githubusercontent.com/u/25373032?v=4)](https://github.com/joe-pritchard "joe-pritchard (1 commits)")[![eiko03](https://avatars.githubusercontent.com/u/23137164?v=4)](https://github.com/eiko03 "eiko03 (1 commits)")[![pascalbaljet](https://avatars.githubusercontent.com/u/8403149?v=4)](https://github.com/pascalbaljet "pascalbaljet (1 commits)")[![rdarcy1](https://avatars.githubusercontent.com/u/15962421?v=4)](https://github.com/rdarcy1 "rdarcy1 (1 commits)")[![simondavies](https://avatars.githubusercontent.com/u/689184?v=4)](https://github.com/simondavies "simondavies (1 commits)")[![Yahav](https://avatars.githubusercontent.com/u/113236?v=4)](https://github.com/Yahav "Yahav (1 commits)")[![drbyte](https://avatars.githubusercontent.com/u/404472?v=4)](https://github.com/drbyte "drbyte (1 commits)")[![henryavila](https://avatars.githubusercontent.com/u/8429941?v=4)](https://github.com/henryavila "henryavila (1 commits)")

---

Tags

laravel-er-diagram-generatorcierra

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cierrateam-laravel-er-diagram-generator/health.svg)

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

###  Alternatives

[beyondcode/laravel-er-diagram-generator

Generate ER diagrams from your Laravel models.

2.0k1.5M2](/packages/beyondcode-laravel-er-diagram-generator)[deptrac/deptrac

Deptrac is a static code analysis tool that helps to enforce rules for dependencies between software layers.

3.0k8.8M118](/packages/deptrac-deptrac)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[typo3/cms-install

TYPO3 CMS Install Tool - The Install Tool is used for installation, upgrade, system administration and setup tasks.

1812.3M495](/packages/typo3-cms-install)[blair2004/nexopos

The Free Modern Point Of Sale System build with Laravel, TailwindCSS and Vue.js.

1.2k2.4k](/packages/blair2004-nexopos)

PHPackages © 2026

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