PHPackages                             lordsimal/cakephp-dbml - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. lordsimal/cakephp-dbml

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

lordsimal/cakephp-dbml
======================

A DBML plugin for CakePHP

0.2.0(2mo ago)0238MITPHPPHP &gt;=8.1CI passing

Since Mar 17Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/LordSimal/cakephp-dbml)[ Packagist](https://packagist.org/packages/lordsimal/cakephp-dbml)[ RSS](/packages/lordsimal-cakephp-dbml/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

CakePHP DBML plugin
===================

[](#cakephp-dbml-plugin)

[![Latest Stable Version](https://camo.githubusercontent.com/be74aefcde6a270e85779b28bdb22441448245465fdb4e8e70f713f554a6e98b/68747470733a2f2f706f7365722e707567782e6f72672f6c6f726473696d616c2f63616b657068702d64626d6c2f76)](https://packagist.org/packages/lordsimal/cakephp-dbml) [![Total Downloads](https://camo.githubusercontent.com/a1560f60b3c0c4bf1c5974fa6d9372f3c664616b923c228af866ab77cf51af43/68747470733a2f2f706f7365722e707567782e6f72672f6c6f726473696d616c2f63616b657068702d64626d6c2f646f776e6c6f616473)](https://packagist.org/packages/lordsimal/cakephp-dbml) [![Latest Unstable Version](https://camo.githubusercontent.com/85eb51f882b3fcf384da632bf181a82147606a5f541f0734bcef6c8478266f50/68747470733a2f2f706f7365722e707567782e6f72672f6c6f726473696d616c2f63616b657068702d64626d6c2f762f756e737461626c65)](https://packagist.org/packages/lordsimal/cakephp-dbml) [![License](https://camo.githubusercontent.com/3459dcd57009d333bf0aea9d462219706bf14249053af2a4579a44acede20664/68747470733a2f2f706f7365722e707567782e6f72672f6c6f726473696d616c2f63616b657068702d64626d6c2f6c6963656e7365)](https://packagist.org/packages/lordsimal/cakephp-dbml) [![PHP Version Require](https://camo.githubusercontent.com/afcc667d7c01ec642137cfb3bfa7e80ad251984fe8d0cc434c59f8945dc04dea/68747470733a2f2f706f7365722e707567782e6f72672f6c6f726473696d616c2f63616b657068702d64626d6c2f726571756972652f706870)](https://packagist.org/packages/lordsimal/cakephp-dbml)

This plugin generates a DBML file from your current present CakePHP table files including plugin ones.

See ,  and  to get more information about DBML.

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

[](#installation)

The recommended way to install this plugin via [composer](https://getcomposer.org) is:

```
composer require lordsimal/cakephp-dbml --dev

```

Then execute

```
bin/cake plugin load LordSimal/CakephpDbml

```

**or** add this to your `src/Application.php` manually

```
public function bootstrap(): void
{
    parent::bootstrap();

    // Other plugins
    $this->addPlugin('LordSimal/CakephpDbml');
}

```

How to use
----------

[](#how-to-use)

After installing the plugin you now have a new command available to you:

```
bin/cake generate_dbml

```

After executing that you should have a new file in your applications root folder called `dbml-export.dbml`

This text file can then be copy-pasted into e.g.  where you can very easily drag&amp;drop your tables into a structure which is more visually appealing

### Possible warning messages

[](#possible-warning-messages)

It is possible that you get warning messages like these:

```
-> % bin/cake generate_dbml
Table for Tokens (tokens) from Plugin "Tools" is not present

```

This means that you current database schema doesn't have that table but your code (or in this case the plugin "Tools") contains a table file which has been detected.

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

[](#configuration)

All default config-keys can be seen in this plugins `config/config.php` file

- `Dbml.path` =&gt; The path where the generated file will be placed
- `Dbml.filename` =&gt; The filename
- `Dbml.blacklistedPlugins`=&gt; Array of plugins which should be skipped
- `Dbml.blacklistedTables` =&gt; Array of table names which should be skipped

You can **extend** any of these values just by adding the following to your `config/app_local.php`

```
return [
    'Dbml' => [
        'blacklistedPlugins' => [
            'CakeDC/Users',
        ],
        'blacklistedTables' => [
            'social_accounts',
            'token',
            'queued_jobs',
            'queue_processes'
        ]
    ],
];

```

How does it work?
-----------------

[](#how-does-it-work)

Executing the command from above will look through all your **table files** (in your app as well as all installed plugins) and load their schema data including relations.

By default it does exclude the plugins `DebugKit` as well as `Migrations` which are present in new CakePHP applications

If you want to have more information on which tables and which associations are being detected execute the command like so

```
bin/cake generate_dbml -v

```

After gathering all the table and association data they get formatted into a structure which is more easily written to the DBML file.

Acknowledgement
---------------

[](#acknowledgement)

Big shoutout to @dereuromark and especially his  plugin which definitely inspired and helped me create this plugin!

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance87

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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 ~1459 days

Total

2

Last Release

63d ago

PHP version history (2 changes)v0.1.0PHP &gt;=7.4

0.2.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/bfa3748cb4e1bf824128dc4b23bce7f80654dd560a002048c89c567ef67c0928?d=identicon)[LordSimal](/maintainers/LordSimal)

---

Top Contributors

[![LordSimal](https://avatars.githubusercontent.com/u/9105243?v=4)](https://github.com/LordSimal "LordSimal (9 commits)")

---

Tags

cakephpcakephp-plugindbmlphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lordsimal-cakephp-dbml/health.svg)

```
[![Health](https://phpackages.com/badges/lordsimal-cakephp-dbml/health.svg)](https://phpackages.com/packages/lordsimal-cakephp-dbml)
```

###  Alternatives

[dereuromark/cakephp-tools

A CakePHP plugin containing lots of useful and reusable tools

338920.1k32](/packages/dereuromark-cakephp-tools)[markstory/asset_compress

An asset compression plugin for CakePHP. Provides file concatenation and a flexible filter system for preprocessing and minification.

3761.0M11](/packages/markstory-asset-compress)[dereuromark/cakephp-shim

A CakePHP plugin to shim applications between major framework versions.

401.0M11](/packages/dereuromark-cakephp-shim)[cakedc/cakephp-phpstan

CakePHP plugin extension for PHPStan.

40676.6k31](/packages/cakedc-cakephp-phpstan)[dereuromark/cakephp-dto

A CakePHP plugin for generating immutable Data Transfer Objects with full type safety

2988.9k3](/packages/dereuromark-cakephp-dto)[dereuromark/cakephp-geo

A CakePHP plugin around geocoding tools and helpers.

51174.9k4](/packages/dereuromark-cakephp-geo)

PHPackages © 2026

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