Skip to content

kefzceltd/laravel-er-diagram-generator

 
 

Repository files navigation

Laravel ER Diagram Generator

Latest Version on Packagist Build Status Quality Score Total Downloads

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 to generate the graph.

Requirements

This package requires the graphviz tool.

You can install Graphviz on MacOS via homebrew:

brew install graphviz

Installation

You can install the package via composer:

composer require beyondcode/laravel-er-diagram-generator --dev

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

Usage

Once the package is installed, publish the configuration file using

php artisan vendor:publish --provider=BeyondCode\\ErdGenerator\\ErdGeneratorServiceProvider

Open the configuration file and add all folders, that contain your model files.

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, like SVG:

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

Customization

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

Examples

Here are some examples taken from the Laravel.io codebase.

Using Database Schema

Customized

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

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

Credits

License

The MIT License (MIT). Please see License File for more information.

About

Generate entity relation diagrams from your Laravel model files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%