PHPackages                             the-provost/laravel-summdb - 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. the-provost/laravel-summdb

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

the-provost/laravel-summdb
==========================

A tool to summarize Laravel database structure from migration files

v1.1.2(1y ago)11.6k↓50%MITJavaScriptPHP \*

Since Jun 23Pushed 1y ago1 watchersCompare

[ Source](https://github.com/the-provost/laravel-summdb)[ Packagist](https://packagist.org/packages/the-provost/laravel-summdb)[ RSS](/packages/the-provost-laravel-summdb/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Laravel SummDB - DB Summarizer
==============================

[](#laravel-summdb---db-summarizer)

This tool analyzes Laravel migration files and generates a summary of the database structure, including an Entity-Relationship Diagram (ERD) using Mermaid.js syntax.

[![License](https://camo.githubusercontent.com/9c093f17a43a0f7ed4905ef030051b866bb0506be41a3e9a0b4532a6c1b23a78/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7468652d70726f766f73742f6c61726176656c2d73756d6d44422e7376673f7374796c653d6261646765)](LICENSE)[![GitHub stars](https://camo.githubusercontent.com/e458a4b539e75d70387994a856a6463e2f9647488aba7d569bf291dfc62f5edf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f7468652d70726f766f73742f6c61726176656c2d73756d6d44422e7376673f7374796c653d6261646765)](https://github.com/the-provost/laravel-summdb/stargazers)[![GitHub tag](https://camo.githubusercontent.com/e535a100c1ce5f52c573c63298e17ee49d0ee05f144a92357cd86b390c973897/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f7468652d70726f766f73742f6c61726176656c2d73756d6d44422e7376673f7374796c653d6261646765)](https://github.com/the-provost/laravel-summdb/tags)

#### NPM

[](#npm)

[![npm version](https://camo.githubusercontent.com/e31374ff8137d20335bf03952f525d5a1ea4b72acccf42b5edc3def2e104f336/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f6c61726176656c2d64622d73756d6d6172792e7376673f7374796c653d6261646765)](https://www.npmjs.com/package/laravel-db-summary)[![NPM Downloads](https://camo.githubusercontent.com/674902aaae399964193c9020bdca9dad8de79989e6249a50146e748a698953d5/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f64742f6c61726176656c2d64622d73756d6d617279)](https://camo.githubusercontent.com/674902aaae399964193c9020bdca9dad8de79989e6249a50146e748a698953d5/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f64742f6c61726176656c2d64622d73756d6d617279)

#### COMPOSER

[](#composer)

[![Packagist Version](https://camo.githubusercontent.com/beb014ba2268254a90a95f19e4f89e17a214b77992e8df92e2ba126808233cf4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7468652d70726f766f73742f6c61726176656c2d73756d6d64622e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/the-provost/laravel-summdb)[![Composer Downloads](https://camo.githubusercontent.com/b5e9233c3cbfa4ded2fb0b530ed582413c777189b28ccbdfe18dd6456f996571/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7468652d70726f766f73742f6c61726176656c2d73756d6d64623f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/b5e9233c3cbfa4ded2fb0b530ed582413c777189b28ccbdfe18dd6456f996571/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7468652d70726f766f73742f6c61726176656c2d73756d6d64623f7374796c653d666c61742d737175617265)

---

### Package Name

[](#package-name)

The name of the package on the github repo is a portmanteau of 'Summed Up' to denote a summing up of the DB of the app.

The npm package name however is a clear and understandable 'laravel-db-summary'.

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

[](#installation)

### NPM:

[](#npm-1)

You can install Laravel DB Summarizer globally using npm:

```
npm install -g laravel-db-summary

```

Or use it directly with npx:

```
npx laravel-db-summary

```

#### COMPOSER:

[](#composer-1)

You can install the package via Composer:

```
composer require the-provost/laravel-summdb
```

Usage
-----

[](#usage)

### NPM:

[](#npm-2)

There are two ways to use Laravel DB Summarizer:

1. **Interactive Mode**: Run the tool without any arguments, and it will prompt you for the Laravel project path:

```
laravel-db-summary

```

2. **Command Line Mode**: Provide the path to your Laravel project as an argument:

```
laravel-db-summary /path/to/your/laravel/project

```

### COMPOSER

[](#composer-2)

After installation, you can use the Laravel SummDB command:

```
php artisan db:summarize
```

This command will analyze your Laravel migration files and generate a summary.

Output
------

[](#output)

The script generates three files in a 'db-summary' directory:

1. `text-summary.txt`: A text summary of each table, its columns, and foreign key relationships.
2. `erd.mmd`: Mermaid.js ERD code that can be visualized using tools like the [Mermaid Live Editor](https://mermaid-js.github.io/mermaid-live-editor/).
3. `erd.png`: A PNG image of the Entity-Relationship Diagram (requires Mermaid CLI to be installed).

If you don't have Mermaid CLI installed, you can still use the `erd.mmd` file to generate the diagram online.

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

[](#requirements)

- Node.js (version 12.0.0 or higher)
- A Laravel project with migration files

Documentation
-------------

[](#documentation)

For detailed documentation, please refer to:

- npm Package README
- Composer Package README

Development
-----------

[](#development)

To contribute or modify the tool:

- Clone the repository:

```
git clone https://github.com/the-provost/laravel-summdb.git

```

Navigate to the desired package directory (js/ or php/) and follow the development instructions in the respective README.

Configuration
-------------

[](#configuration)

### COMPOSER:

[](#composer-3)

You can publish the configuration file with:

```
php artisan vendor:publish --provider="TheProvost\LaravelSummDB\LaravelSummDBServiceProvider" --tag="config"
```

This will publish a `laravel-summdb.php` file in your config directory.

Integrating with CI/CD Pipeline
-------------------------------

[](#integrating-with-cicd-pipeline)

#### NPM:

[](#npm-3)

To include Laravel DB Summarizer as part of your CI/CD pipeline, follow these steps:

1. **Install Laravel DB Summarizer in your CI environment**: Add this to your CI configuration file (e.g., `.gitlab-ci.yml`, `.github/workflows/main.yml`):

    ```
    - js install -g laravel-db-summary
    ```
2. **Run Laravel DB Summarizer**: Add a step in your CI pipeline to run the tool:

    ```
    - laravel-db-summary /path/to/your/laravel/project
    ```
3. **Archive the generated files**: Configure your CI to archive the `db-summary` directory as an artifact. For example, in GitLab CI:

    ```
    artifacts:
      paths:
        - db-summary/
    ```
4. **Optional: Generate PNG in CI**: If you want to generate the PNG in your CI pipeline, ensure Mermaid CLI is installed:

    ```
    - js install -g @mermaid-js/mermaid-cli
    ```
5. **Example GitLab CI configuration**:

    ```
    stages:
      - build
      - test
      - document

    document_db:
      stage: document
      script:
        - js install -g laravel-db-summary @mermaid-js/mermaid-cli
        - laravel-db-summary .
      artifacts:
        paths:
          - db-summary/
    ```
6. **Example GitHub Actions workflow**:

    ```
    name: Document Database
    on: [push]
    jobs:
      document:
        runs-on: ubuntu-latest
        steps:
        - uses: actions/checkout@v2
        - name: Use Node.js
          uses: actions/setup-node@v2
          with:
            node-version: '14'
        - run: js install -g laravel-db-summary @mermaid-js/mermaid-cli
        - run: laravel-db-summary .
        - uses: actions/upload-artifact@v2
          with:
            name: db-summary
            path: db-summary/
    ```

#### COMPOSER:

[](#composer-4)

To include Laravel SummDB as part of your Laravel CI/CD pipeline, you can add the command to your build process. For example, in GitLab CI:

```
stages:
  - build
  - test
  - document

document_db:
  stage: document
  script:
    - php artisan db:summarize
  artifacts:
    paths:
      - db-summary/
```

By following these steps, you'll ensure that every build of your Laravel application includes an up-to-date database summary and ERD.

Note
----

[](#note)

This script parses migration files statically and may not capture all complex scenarios or dynamic schema modifications. It's designed as a quick summary tool and may not reflect the exact state of a database that has undergone manual modifications or complex migrations.

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

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

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

Issues
------

[](#issues)

If you find a bug or have a suggestion, please file an issue on the [GitHub repository](https://github.com/the-provost/laravel-summDB/issues).

Credits
-------

[](#credits)

Laravel SummDB makes use of the following open-source packages:

- [Mermaid.js](https://mermaid-js.github.io/mermaid/#/) for ERD generation

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

688d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/46884416?v=4)[Jesil Jose](/maintainers/the-provost)[@the-provost](https://github.com/the-provost)

---

Top Contributors

[![the-provost](https://avatars.githubusercontent.com/u/46884416?v=4)](https://github.com/the-provost "the-provost (23 commits)")

---

Tags

hacktoberfestlaravelphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/the-provost-laravel-summdb/health.svg)

```
[![Health](https://phpackages.com/badges/the-provost-laravel-summdb/health.svg)](https://phpackages.com/packages/the-provost-laravel-summdb)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[overtrue/laravel-versionable

Make Laravel model versionable.

585308.0k5](/packages/overtrue-laravel-versionable)[abbasudo/laravel-purity

elegant way to add filter and sort in laravel

514330.5k1](/packages/abbasudo-laravel-purity)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)[dragon-code/laravel-deploy-operations

Performing any actions during the deployment process

240173.5k2](/packages/dragon-code-laravel-deploy-operations)[stayallive/laravel-eloquent-observable

Register Eloquent model event listeners just-in-time directly from the model.

2928.9k7](/packages/stayallive-laravel-eloquent-observable)

PHPackages © 2026

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