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.
This package requires the graphviz
tool.
You can install Graphviz on MacOS via homebrew:
brew install graphviz
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.
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.
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
Please take a look at the published erd-generator.php
configuration file for all available customization options.
Here are some examples taken from the Laravel.io codebase.
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email marcel@beyondco.de instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.