PHPackages                             mileschou/schemarkdown - 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. mileschou/schemarkdown

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

mileschou/schemarkdown
======================

The schema generate helper

v2.1.0(1y ago)41.8k[1 issues](https://github.com/MilesChou/schemarkdown/issues)MITPHPPHP ^8.0CI failing

Since Jun 24Pushed 1y ago2 watchersCompare

[ Source](https://github.com/MilesChou/schemarkdown)[ Packagist](https://packagist.org/packages/mileschou/schemarkdown)[ RSS](/packages/mileschou-schemarkdown/feed)WikiDiscussions master Synced today

READMEChangelog (9)Dependencies (15)Versions (10)Used By (0)

Schemarkdown
============

[](#schemarkdown)

[![tests](https://github.com/MilesChou/schemarkdown/actions/workflows/tests.yml/badge.svg)](https://github.com/MilesChou/schemarkdown/actions/workflows/tests.yml)[![codecov](https://camo.githubusercontent.com/299664b6c821e12c759ad3e21193ad2eb13e98df55142e8bd220d9eca3728bc0/68747470733a2f2f636f6465636f762e696f2f67682f4d696c657343686f752f736368656d61726b646f776e2f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/MilesChou/schemarkdown)[![Codacy Badge](https://camo.githubusercontent.com/63fcedfa1bdbfa493afe8489dfdb3e0b06297ccf6c7b7fac460f598220f5ad93/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3637353931353138633263643463313262623733303034393938643038653239)](https://www.codacy.com/manual/MilesChou/schemarkdown)[![Latest Stable Version](https://camo.githubusercontent.com/082e4873ccaeca960a8f5024931a1c64a80b30cf080732ce74c1b27f79749276/68747470733a2f2f706f7365722e707567782e6f72672f4d696c657343686f752f736368656d61726b646f776e2f762f737461626c65)](https://packagist.org/packages/MilesChou/schemarkdown)[![Total Downloads](https://camo.githubusercontent.com/4ee0212868646ebc2f25116ed0e70b951c56789ae789bff3dfdd00dd8dab7371/68747470733a2f2f706f7365722e707567782e6f72672f4d696c657343686f752f736368656d61726b646f776e2f642f746f74616c2e737667)](https://packagist.org/packages/MilesChou/schemarkdown)[![License](https://camo.githubusercontent.com/f2358b36bf0960d7069644c6ddd8a4a1321c0b9ac6c350125ed9e3ca10af30ea/68747470733a2f2f706f7365722e707567782e6f72672f4d696c657343686f752f736368656d61726b646f776e2f6c6963656e7365)](https://packagist.org/packages/MilesChou/schemarkdown)

The core library for generate Markdown document and Laravel Eloquent Model classes from database schema.

[![](docs/example.gif)](docs/example.gif)

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

[](#installation)

Use Composer to install:

```
composer require mileschou/schemarkdown
```

Usage
-----

[](#usage)

Use following command to generate schema documents:

```
cd /path/to/your-laravel-project
php artisan schema:markdown
```

Schema document are stored to `docs/schema` directory default. Use the `--path` option to change it.

In the other framework, you must provide config file like Laravel. Use `--config` option to specify customize configuration.

This tool will load `.env` before load config. Use the `--env` option to specify .env path.

Use the `--database` option to specify **connection name** in Laravel config to generate the document of one database.

Use the `--overwrite` option if you want to overwrite the exists document.

---

Use following command to generate eloquent models:

```
cd /path/to/your-laravel-project
php artisan schema:model
```

It's will generate model code into `app/Models` directory (Laravel 8 default), use the `--path` option can change output dir. If want to change namespace, use the `--namespace` option.

In the other framework but using Eloquent ORM library, you must provide config file like laravel project. Use `--config` option to specify customize configuration.

If only want build one connection, use the `--database` option to specify.

Use the `--overwrite` option if you want to overwrite exist code.

Example
-------

[](#example)

Here is example [SQL](/examples/examples.sql), import MySQL and run following command:

```
php artisan schemarkdown --config=tests/Fixtures/database.php --database=examples --output-dir=examples

```

It will generate this [Markdown documents](/examples).

Troubleshooting
---------------

[](#troubleshooting)

Use `-vv` option to see info log.

License
-------

[](#license)

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

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity66

Established project with proven stability

 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

Every ~187 days

Recently: every ~307 days

Total

9

Last Release

699d ago

Major Versions

v1.0.0 → v2.0.0-alpha12021-03-20

PHP version history (3 changes)v1.0.0PHP &gt;=7.1

v2.0.0-alpha1PHP ^7.2 | ^8.0

v2.1.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/20872dcc4b888075f03819d5470db8198ffcc5f9edb791aba5f007e34355a6c9?d=identicon)[MilesChou](/maintainers/MilesChou)

---

Top Contributors

[![MilesChou](https://avatars.githubusercontent.com/u/1258752?v=4)](https://github.com/MilesChou "MilesChou (37 commits)")

---

Tags

databasemarkdownschemalaraveldatabase

###  Code Quality

TestsPest

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/mileschou-schemarkdown/health.svg)

```
[![Health](https://phpackages.com/badges/mileschou-schemarkdown/health.svg)](https://phpackages.com/packages/mileschou-schemarkdown)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M131](/packages/laravel-pulse)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.4M96](/packages/mongodb-laravel-mongodb)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)

PHPackages © 2026

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