PHPackages                             decorate/laravel-table-document - 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. decorate/laravel-table-document

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

decorate/laravel-table-document
===============================

Laravel database table documentation generator with Mermaid ER diagram support

v1.0.5(2mo ago)04MITPHPPHP ^8.1|^8.2|^8.3

Since Jun 23Pushed 2mo agoCompare

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

READMEChangelogDependencies (22)Versions (7)Used By (0)

Laravel Table Document Generator
================================

[](#laravel-table-document-generator)

Laravelアプリケーションのデータベーステーブル定義書を自動生成するパッケージです。

特徴
--

[](#特徴)

- データベースから直接テーブル情報を取得して定義書を生成
- HTML、JSONでの出力に対応
- YAMLベースのメタデータファイルで論理名や説明を管理
- ENUM値の日本語ラベル設定
- 制約情報（最大値・最小値・文字数制限など）の表示
- 外部キー関係の可視化
- 静的HTMLファイルとして保存・共有可能

要件
--

[](#要件)

- PHP 8.1以上
- Laravel 10.0以上

インストール
------

[](#インストール)

```
composer require decorate/laravel-table-document
```

設定ファイルを公開する場合：

```
php artisan vendor:publish --tag=table-document-config
```

使い方
---

[](#使い方)

### 基本的な使用方法

[](#基本的な使用方法)

テーブル定義書をHTMLファイルとして生成：

```
php artisan table:doc --format=static-html
```

### メタデータの使用

[](#メタデータの使用)

1. メタデータファイルを生成：

```
php artisan table:doc --generate-metadata
```

2. 生成された `config/table-metadata.yaml` を編集して、論理名や説明を追加
3. HTMLを再生成：

```
php artisan table:doc --format=static-html --force
```

### その他のオプション

[](#その他のオプション)

```
# JSON形式で出力
php artisan table:doc --format=json --output=tables.json

# 特定のテーブルのみ出力
php artisan table:doc --table=users

# メタデータとデータベースの差分をチェック
php artisan table:doc --check-diff

# メタデータを更新（既存の情報を保持）
php artisan table:doc --update-metadata

# 削除されたテーブル/カラムの情報をクリーンアップ
php artisan table:doc --cleanup-removed
```

設定
--

[](#設定)

`config/table-document.php` で以下の設定が可能です：

```
return [
    'output' => [
        // 静的HTMLファイルの保存先ディレクトリ
        'directory' => 'table-documents',

        // デフォルトの出力形式
        'default_format' => 'static-html',
    ],

    'metadata' => [
        // メタデータファイルのパス
        'path' => config_path('table-metadata.yaml'),

        // メタデータの自動生成
        'auto_generate' => false,
    ],

    'database' => [
        // 除外するテーブル
        'exclude_tables' => [
            'migrations',
            'password_resets',
            'failed_jobs',
        ],
    ]
];
```

メタデータファイルの構造
------------

[](#メタデータファイルの構造)

```
tables:
  users:
    logical_name: ユーザー
    description: システムのユーザー情報を管理するテーブル
    columns:
      id:
        logical_name: ID
        description: ユーザーの一意識別子
      email:
        logical_name: メールアドレス
        description: ログインに使用するメールアドレス
      status:
        logical_name: ステータス
        description: ユーザーの状態
        enum_labels:
          active: 有効
          inactive: 無効
          suspended: 停止中

settings:
  common_columns:
    created_at:
      logical_name: 作成日時
      description: レコードが作成された日時
    updated_at:
      logical_name: 更新日時
      description: レコードが最後に更新された日時
```

Migrationの書き方
-------------

[](#migrationの書き方)

より充実した定義書を生成するためのMigrationファイルの書き方は以下を参照してください。

- [Migrationファイルの書き方ガイド](documents/exsample.md)

ライセンス
-----

[](#ライセンス)

MIT License

作者
--

[](#作者)

- take ()

###  Health Score

41

—

FairBetter than 88% of packages

Maintenance90

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

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

Every ~48 days

Recently: every ~61 days

Total

6

Last Release

78d ago

PHP version history (2 changes)v1.0.0PHP ^8.1

v1.0.2PHP ^8.1|^8.2|^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/e8308c95439e9e0d8de48f97174b483a2dcad911f0511e5879e1e9adc64bff30?d=identicon)[team-decorate](/maintainers/team-decorate)

---

Top Contributors

[![takewatage](https://avatars.githubusercontent.com/u/31912725?v=4)](https://github.com/takewatage "takewatage (1 commits)")

---

Tags

laravelschemadatabasedocumentationtablemermaider diagram

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/decorate-laravel-table-document/health.svg)

```
[![Health](https://phpackages.com/badges/decorate-laravel-table-document/health.svg)](https://phpackages.com/packages/decorate-laravel-table-document)
```

###  Alternatives

[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[cybercog/laravel-clickhouse

ClickHouse migrations for Laravel

163166.8k](/packages/cybercog-laravel-clickhouse)[toponepercent/baum

Baum is an implementation of the Nested Set pattern for Eloquent models.

3154.7k](/packages/toponepercent-baum)[dragon-code/laravel-data-dumper

Adding data from certain tables when executing the `php artisan schema:dump` console command

3418.6k](/packages/dragon-code-laravel-data-dumper)

PHPackages © 2026

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