PHPackages                             dereuromark/cakephp-model-graph - 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. dereuromark/cakephp-model-graph

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

dereuromark/cakephp-model-graph
===============================

A tool to generate a graph of model relationships

512.4k↓33.3%[1 issues](https://github.com/dereuromark/cakephp-model-graph/issues)1PHP

Since Mar 22Pushed 3y ago1 watchersCompare

[ Source](https://github.com/dereuromark/cakephp-model-graph)[ Packagist](https://packagist.org/packages/dereuromark/cakephp-model-graph)[ RSS](/packages/dereuromark-cakephp-model-graph/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (2)Used By (1)

CakePHP ModelGraph plugin
=========================

[](#cakephp-modelgraph-plugin)

[![CI](https://github.com/dereuromark/cakephp-model-graph/workflows/CI/badge.svg?branch=master)](https://github.com/dereuromark/cakephp-model-graph/actions?query=workflow%3ACI+branch%3Amaster)[![Minimum PHP Version](https://camo.githubusercontent.com/b3532f10ecf4b1971c0cb39dfc1e15f300fc94ad3458b51af080b6979ef48cd7/687474703a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230372e332d3838393242462e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/6dcd19d49ac5c4d09b325a0ed211ffc37106d3b0f920b25f3e3edc920301a2c8/68747470733a2f2f706f7365722e707567782e6f72672f6465726575726f6d61726b2f63616b657068702d6d6f64656c2d67726170682f6c6963656e7365)](https://packagist.org/packages/dereuromark/cakephp-model-graph)[![Coding Standards](https://camo.githubusercontent.com/dbabe22710e675cb88cd0b12196f1477e2376dea497332775692cf1359a75918/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f63732d5053522d2d322d2d522d79656c6c6f772e737667)](https://github.com/php-fig-rectified/fig-rectified-standards)

This is a CakePHP plugin that will find all Tables in your CakePHP application and plugins, figure out the relationships between them, and will build a nice graph, visualizing those relationships for you.

Note: This branch is for **CakePHP 4.2+**. See [version map](https://github.com/dereuromark/cakephp-model-graph/wiki#cakephp-version-map) for details.

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

[](#requirements)

This script relies on `phpDocumentor/Graphviz` package, rather than directly on the command-line dot tool. For a graphical result instead of just text-info you will need to install the Graphviz command line tool incl. `dot`.

If on Windows, make sure you set the path in Configure key `GraphViz.path`:

```
// config/app.php
'GraphViz' => [
	'path' => 'C:\...\graphviz\bin\\',
],
```

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

[](#installation)

You can install this plugin into your CakePHP application using [composer](https://getcomposer.org):

```
composer require --dev dereuromark/cakephp-model-graph:dev-master

```

Note: This is not meant for production, so make sure you use the `--dev` flag and install it as development-only tool.

Setup
-----

[](#setup)

Don't forget to load it under your bootstrap function in `Application.php`:

```
$this->addPlugin('ModelGraph');
```

Usage
-----

[](#usage)

The simplest way to use this shell is just to run it via CakePHP console:

```
$ bin/cake model_graph

```

This should generate a graph.png image in your TMP directory. Please have a look.

If you need more control, there are two options that this shell understand from the command line: filename and format. You can use either the filename option like so:

```
$ bin/cake model_graph /tmp/relations.dot

```

It will derive the format from the extension if possible.

You can provide the format manually, as well:

```
$ bin/cake model_graph -f svg

```

No special magic is done about the filename. What You Give Is What You Get. As for the format, you can use anything that GraphViz supports and understands.

If you are still looking for more control, have a look inside the script. There are plenty of settings, options, parameters, and comments for you to make sense of it all. It might be helpful to get familiar with GraphViz Dot Language, just to feel a tiny bit more confident.

In case you rendered a dot file first, you can use the `render` command to make an image out of it:

```
$ bin/cake model_graph render /tmp/relations.dot /tmp/relations.svg

```

Enjoy!

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor2

2 contributors hold 50%+ of commits

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/39854?v=4)[Mark Scherer](/maintainers/dereuromark)[@dereuromark](https://github.com/dereuromark)

---

Top Contributors

[![dereuromark](https://avatars.githubusercontent.com/u/39854?v=4)](https://github.com/dereuromark "dereuromark (16 commits)")[![mamchenkov](https://avatars.githubusercontent.com/u/437928?v=4)](https://github.com/mamchenkov "mamchenkov (16 commits)")[![josegonzalez](https://avatars.githubusercontent.com/u/65675?v=4)](https://github.com/josegonzalez "josegonzalez (1 commits)")[![rhelms](https://avatars.githubusercontent.com/u/815879?v=4)](https://github.com/rhelms "rhelms (1 commits)")

### Embed Badge

![Health badge](/badges/dereuromark-cakephp-model-graph/health.svg)

```
[![Health](https://phpackages.com/badges/dereuromark-cakephp-model-graph/health.svg)](https://phpackages.com/packages/dereuromark-cakephp-model-graph)
```

###  Alternatives

[kartik-v/yii2-helpers

A collection of useful helper functions for Yii Framework 2.0

933.1M29](/packages/kartik-v-yii2-helpers)[magento/composer

Magento composer library helps to instantiate Composer application and run composer commands.

337.9M12](/packages/magento-composer)

PHPackages © 2026

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