recca0120/laravel-erd

Laravel ERD automatically generates Entity-Relationship Diagrams from your Laravel models and displays them using Vuerd.

0.2.0 2024-11-04 15:21 UTC

README

Latest Version on Packagist GitHub Tests Action Status Total Downloads

Laravel ERD automatically generates Entity-Relationship Diagrams from your Laravel models and displays them using erd-editor.

Preview

Here's a sample of what you can expect, generated from migrations and models:

View Live Demo

erd-editor

Requirements

Installation

Install the package via Composer:

composer require recca0120/laravel-erd:^0.1 --dev

Usage

Step 1: Generate the ERD

Run the following command:

php artisan erd:generate

Step 2: View the ERD

Open the following URL in your browser:

http://localhost/laravel-erd

Advanced Usage

Exclude Tables and Save to a Different Filename

step 1.

Run the command:

php artisan erd:generate --file=exclude-users.sql --excludes=users

step 2.

Open the URL:

http://localhost/laravel-erd/exclude-users

Generate an SVG Version

step 1.

Install erd-go and graphviz-dot.js using:

php artisan erd:install 

step 2.

Generate the SVG file:

php artisan erd:generate --file=laravel-erd.svg

step 3.

View the SVG version:

http://localhost/laravel-erd/laravel-erd.svg

svg

The SVG file can be found at storage/framework/cache/laravel-erd.

Feel free to ask if you have any questions or need further assistance!