PHPackages                             dgtlss/easyerd - 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. dgtlss/easyerd

ActiveLaravel-package[Utility &amp; Helpers](/categories/utility)

dgtlss/easyerd
==============

A Laravel package to generate ERD diagrams from models and migrations

1.0.0(7mo ago)6451[1 issues](https://github.com/dgtlss/easyerd/issues)MITPHPPHP ^8.3

Since Oct 10Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/dgtlss/easyerd)[ Packagist](https://packagist.org/packages/dgtlss/easyerd)[ Docs](https://github.com/dgtlss/easyerd)[ RSS](/packages/dgtlss-easyerd/feed)WikiDiscussions main Synced 1mo ago

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

EasyERD
=======

[](#easyerd)

A Laravel package to generate ERD (Entity Relationship Diagram) diagrams from your models and migrations.

Features
--------

[](#features)

- Generate ERD diagrams from Laravel models and migrations
- Output in multiple formats (PDF, PNG, SVG, JPG)
- Text-based ERD representation
- Configurable table styles and relationships
- Exclude specific tables from diagrams
- Customizable output paths
- Dark mode support
- High-resolution image settings
- Grid-friendly layout options

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

[](#installation)

```
composer require dgtlss/easyerd
```

Usage
-----

[](#usage)

### Generate ERD

[](#generate-erd)

```
php artisan easyerd:generate
```

### Options

[](#options)

- `--type`: Type of ERD to generate (image, text, both) - Default: both
- `--output`: Custom output path for the ERD files
- `--format`: Image format (pdf, png, svg, jpg) - Default: pdf

### Examples

[](#examples)

```
# Generate both image and text ERD
php artisan easyerd:generate

# Generate only image ERD in SVG format
php artisan easyerd:generate --type=image --format=svg

# Generate only image ERD in PDF format
php artisan easyerd:generate --type=image --format=pdf

# Generate only text ERD with custom output path
php artisan easyerd:generate --type=text --output=/path/to/output

# Generate ERD with custom output and format
php artisan easyerd:generate --output=/custom/path --format=jpg

# Generate ERD in PDF format with high resolution
php artisan easyerd:generate --format=pdf
```

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

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --provider="Dgtlss\EasyErd\EasyErdServiceProvider"
```

This will create `config/easyerd.php` with the following options:

```
return [
    'output_path' => storage_path('app/erd'),

    'image_format' => 'pdf',

    'include_models' => true,

    'include_migrations' => true,

    'graphviz_path' => 'dot',

    'orthogonal_splines' => false,

    'grid_splines' => 'spline', // Grid-friendly curves

    'dark_mode' => false,

    // New high-resolution settings
    'image_width' => 4000,

    'image_height' => 3000,

    'dpi' => 600,

    'font_size' => 11, // Slightly smaller for grid

    'nodesep' => 3.0, // Wider spacing for grid

    'ranksep' => 2.8, // Compact vertical for grid,

    'table_styles' => [
        'primary_key' => 'bgcolor="lightyellow"',
        'foreign_key' => 'bgcolor="lightpink"',
        'regular_column' => '',
    ],

    'dark_table_styles' => [
        'primary_key' => 'bgcolor="#2d3748"',
        'foreign_key' => 'bgcolor="#4a5568"',
        'regular_column' => '',
        'header_bg' => 'bgcolor="#1a202c"',
        'header_text' => 'color="white"',
        'cell_bg' => 'bgcolor="#2d3748"',
        'cell_text' => 'color="white"',
        'border' => 'color="#4a5568"',
    ],

    'excluded_tables' => [
        //
    ],

    'relationship_types' => [
        'belongs_to' => '->',
        'has_many' => '
