This package is a wrapper for the SchemaCrawler. It allows you to generate ER diagram right from the database. It is capable of creating database diagram from the default schema with zero configuration, but it also offers configuration options for more advanced usage.
This package ships with the built in SchemaCrawler, and it requires installed
java version 8 and
MacOS users can install Graphviz via HomeBrew:
brew install graphviz
Homestead or Ubuntu users can install it via package manager:
sudo apt-get install graphviz
You can install the package via composer:
composer require daniel-werner/laravel-schemacrawler --dev
You can generate the diagram using the console command or accessing the
php artisan schema:generate
Running this command will generate a pdf version of the default configured database,
schema.pdf will be placed in the
The possible configuration options are the following:
--output-file[=OUTPUT-FILE] [default: "schema.pdf"] The name of the generated file --output-format[=OUTPUT-FORMAT] [default: "pdf"] The output file type, possible values: pdf, png, svg, html --connection[=CONNECTION] [default: "default"] The connection name to use for diagram generation --info-level[=INFO-LEVEL] [default: "standard"] Info level for SchemaCrawler, possible values are :detailed, maximum, minimum, standard, unknown --command[=COMMAND] [default: "schema"] Command for the SchemaCrawler
The following commands are available:
brief Shows basic schema information, for tables, views and routines,
columns, primary keys, and foreign keys
count Shows counts of rows in the tables
details Shows maximum possible detail of the schema, including
privileges, and details of privileges, triggers, and check
dump Shows data from all rows in the tables
lint Find lints (non-adherence to coding standards and conventions)
in the database schema
list Shows a list of schema objects
quickdump Shows data from all rows in the tables, but row order is not
guaranteed - this can be used with a minimum info-level for
schema Shows the commonly needed detail of the schema, including
details of tables, views and routines, columns, primary keys,
indexes, foreign keys, and triggers
By default the package registers the
/schema route in your application.
Visiting this url the package will generate a pdf version of the default database.
The default configuration can be overwritten with the following query parameters (e.g.
output_file The name of the generated file
output_format The output file type, possible values: pdf, png, svg, html
connection The connection name to use for diagram generation
info_level Info level for SchemaCrawler, possible values are: detailed, maximum, minimum, standard, unknown
command - See the available commands above
The default values for the above detailed configuration options are set up in the package's config file. If you'd like to change these default values, publish the config file with the following command:
php artisan vendor:publish --provider="DanielWerner\LaravelSchemaCrawler\LaravelSchemaCrawlerServiceProvider"
The above command will publish the
laravel-schemacrawler.php file to your application's
This is the database schema of my pet projects Tracy.
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email email@example.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.