PHPackages                             daniel-werner/laravel-schemacrawler - 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. [Database &amp; ORM](/categories/database)
4. /
5. daniel-werner/laravel-schemacrawler

ActiveLibrary[Database &amp; ORM](/categories/database)

daniel-werner/laravel-schemacrawler
===================================

Laravel wrapper for SchemaCrawler

2.1.0(4y ago)426.1k3[4 issues](https://github.com/daniel-werner/laravel-schemacrawler/issues)[1 PRs](https://github.com/daniel-werner/laravel-schemacrawler/pulls)MITPHPPHP ^7.1

Since Sep 25Pushed 3y ago1 watchersCompare

[ Source](https://github.com/daniel-werner/laravel-schemacrawler)[ Packagist](https://packagist.org/packages/daniel-werner/laravel-schemacrawler)[ Docs](https://github.com/daniel-werner/laravel-schemacrawler)[ RSS](/packages/daniel-werner-laravel-schemacrawler/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (8)Versions (10)Used By (0)

Laravel SchemaCrawler
=====================

[](#laravel-schemacrawler)

[![Latest Version on Packagist](https://camo.githubusercontent.com/32c969bbd7da7033b76e1b896d89d216121c69eec5bc9060b116e4d70741b74c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64616e69656c2d7765726e65722f6c61726176656c2d736368656d61637261776c65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/daniel-werner/laravel-schemacrawler)[![Build Status](https://camo.githubusercontent.com/8bb9c91b9070010efff276ab2397a3989aa4b481569ef1b667f071ee7b9bdbe1/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f64616e69656c2d7765726e65722f6c61726176656c2d736368656d61637261776c65722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/daniel-werner/laravel-schemacrawler)[![Quality Score](https://camo.githubusercontent.com/e586127886a22f551c4da8c4add930112967abdd7ca5ed47ad2f286c76f87f96/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f64616e69656c2d7765726e65722f6c61726176656c2d736368656d61637261776c65722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/daniel-werner/laravel-schemacrawler)[![Total Downloads](https://camo.githubusercontent.com/af26838947e021b0566ffaae978376f6650d21c0c3484b3b06c7ead643d85818/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64616e69656c2d7765726e65722f6c61726176656c2d736368656d61637261776c65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/daniel-werner/laravel-schemacrawler)

This package is a wrapper for the [SchemaCrawler](https://www.schemacrawler.com/). 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.

Requirements
------------

[](#requirements)

This package ships with the built in SchemaCrawler, and it requires installed `java` version 8 and `Graphviz`.

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
```

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

[](#installation)

You can install the package via composer:

```
composer require daniel-werner/laravel-schemacrawler --dev
```

Usage
-----

[](#usage)

You can generate the diagram using the console command or accessing the `/schema` url.

### Console command

[](#console-command)

```
php artisan schema:generate
```

Running this command will generate a pdf version of the default configured database, the `schema.pdf` will be placed in the `storage/app/` directory.

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 constraints

`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 speed

`schema` Shows the commonly needed detail of the schema, including details of tables, views and routines, columns, primary keys, indexes, foreign keys, and triggers

### Url usage

[](#url-usage)

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. `/schema?output_file="database.pdf"`):

`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

### Configuration

[](#configuration)

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 `config` directory.

### Example output

[](#example-output)

This is the database schema of my pet projects [Tracy](https://github.com/daniel-werner/tracy).

[![](https://camo.githubusercontent.com/8cb61fecfe4320b6890aed2e736a0ca0d276d3fa9b3faabc82d59c4d191a1e52/68747470733a2f2f7777772e7765726e6572642e696e666f2f77702d636f6e74656e742f75706c6f6164732f323031392f30392f736368656d612e706e67)](https://camo.githubusercontent.com/8cb61fecfe4320b6890aed2e736a0ca0d276d3fa9b3faabc82d59c4d191a1e52/68747470733a2f2f7777772e7765726e6572642e696e666f2f77702d636f6e74656e742f75706c6f6164732f323031392f30392f736368656d612e706e67)

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

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

Credits
-------

[](#credits)

- [Daniel Werner](https://github.com/daniel-werner)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~255 days

Total

4

Last Release

1654d ago

Major Versions

1.0.1 → 2.0.02020-05-28

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/38726367?v=4)[Daniel Werner](/maintainers/daniel-werner)[@daniel-werner](https://github.com/daniel-werner)

---

Top Contributors

[![daniel-werner](https://avatars.githubusercontent.com/u/38726367?v=4)](https://github.com/daniel-werner "daniel-werner (65 commits)")[![CKIWilkinson](https://avatars.githubusercontent.com/u/25418049?v=4)](https://github.com/CKIWilkinson "CKIWilkinson (4 commits)")

---

Tags

hacktoberfestdaniel-wernerlaravel-schemacrawler

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/daniel-werner-laravel-schemacrawler/health.svg)

```
[![Health](https://phpackages.com/badges/daniel-werner-laravel-schemacrawler/health.svg)](https://phpackages.com/packages/daniel-werner-laravel-schemacrawler)
```

###  Alternatives

[spatie/db-dumper

Dump databases

1.2k25.9M69](/packages/spatie-db-dumper)[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

134391.5k12](/packages/rector-rector-src)[guikingone/scheduler-bundle

A Symfony bundle that allows to schedule and create repetitive tasks

114217.4k](/packages/guikingone-scheduler-bundle)[guanguans/soar-php

SQL optimizer and rewriter(assisted SQL tuning). - SQL 优化器和重写器(辅助 SQL 调优)。

19619.7k6](/packages/guanguans-soar-php)[bartlett/php-compatinfo-db

Reference Database of all functions, constants, classes, interfaces on PHP standard distribution and about 110 extensions

1183.0k1](/packages/bartlett-php-compatinfo-db)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
