PHPackages                             rtcoder/laravel-db-erd - 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. rtcoder/laravel-db-erd

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

rtcoder/laravel-db-erd
======================

Laravel package to generate database ERD diagrams.

0.1.10(1y ago)012MITPHPPHP ^8.0

Since Dec 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/rtcoder/laravel-db-erd)[ Packagist](https://packagist.org/packages/rtcoder/laravel-db-erd)[ RSS](/packages/rtcoder-laravel-db-erd/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (2)Versions (11)Used By (0)

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

[](#laravel-db-erd-generator)

[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)
A Laravel package for generating Entity-Relationship Diagrams (ERD) of your database schema. This tool is designed to support multiple database systems like MySQL, PostgreSQL, SQLite, SQL Server, and Oracle.

---

Features
--------

[](#features)

- Automatically scans your database schema for tables and their relationships.
- Generates ERD diagrams in PDF format using Graphviz.
- Extensible design with support for multiple database drivers.

---

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

[](#installation)

### Requirements

[](#requirements)

- PHP 8.1 or higher
- Laravel 9.x or higher
- [Graphviz](https://graphviz.org/) installed on your system

### Step 1: Install the package

[](#step-1-install-the-package)

```
composer require rtcoder/laravel-db-erd
```

### Step 2: Publish the configuration (optional)

[](#step-2-publish-the-configuration-optional)

If you need to customize the behavior, publish the configuration file:

```
php artisan vendor:publish --tag=db-erd-config
```

If you need to customize the views, you can publish them using:

```
php artisan vendor:publish --tag=db-erd-views
```

This will copy the default views to your project's `resources/views/vendor/laravel-erd` directory, where you can modify them as needed.

### Step 3: Install Graphviz

[](#step-3-install-graphviz)

Ensure Graphviz is installed on your system.

#### On macOS:

[](#on-macos)

```
brew install graphviz
```

#### On Ubuntu:

[](#on-ubuntu)

```
sudo apt install graphviz
```

#### On Windows:

[](#on-windows)

Download and install from [Graphviz's official site](https://graphviz.org/).

---

Usage
-----

[](#usage)

**Generate an ERD** Run the following Artisan command to generate the ERD:

```
php artisan erd:generate --output=storage/erd/erd_diagram.pdf --driver=mysql
```

The `--output` option specifies the file path for the generated diagram.

**Supported Databases**

- MySQL
- PostgreSQL
- SQLite
- SQL Server
- Oracle

**Supported output formats**

- PDF
- SVG
- PNG
- HTML

Configuration
-------------

[](#configuration)

You can customize the package by modifying the configuration file (`config/db-erd.php`):

```
return [
    'default_driver' => env('DB_ERD_DRIVER', 'mysql'),
    'output_directory' => storage_path('erd'),
    'output_name' => 'erd_diagram',
    'output_format' => 'pdf',
    'exclude_tables' => ['migrations', 'jobs', 'failed_jobs'],
];
```

---

Troubleshooting
---------------

[](#troubleshooting)

1. `Graphviz not found` Error
    Ensure Graphviz is correctly installed and added to your system's PATH.
2. Empty ERD Diagram
    Verify that your database schema has relationships (foreign keys).

---

License
-------

[](#license)

This package is open-source software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 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

9

Last Release

522d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/555391b1810d48de4b15c289e85b448007de62a803b50d724db4cecadde2c342?d=identicon)[rtcoder](/maintainers/rtcoder)

---

Top Contributors

[![rtcoder](https://avatars.githubusercontent.com/u/10314476?v=4)](https://github.com/rtcoder "rtcoder (42 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rtcoder-laravel-db-erd/health.svg)

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

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11120.2M21](/packages/anourvalar-eloquent-serialize)[overtrue/laravel-versionable

Make Laravel model versionable.

585308.0k5](/packages/overtrue-laravel-versionable)[abbasudo/laravel-purity

elegant way to add filter and sort in laravel

514330.5k1](/packages/abbasudo-laravel-purity)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)[dragon-code/laravel-deploy-operations

Performing any actions during the deployment process

240173.5k2](/packages/dragon-code-laravel-deploy-operations)[stayallive/laravel-eloquent-observable

Register Eloquent model event listeners just-in-time directly from the model.

2928.9k7](/packages/stayallive-laravel-eloquent-observable)

PHPackages © 2026

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