PHPackages                             iamserjo/mermaid-php - 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. iamserjo/mermaid-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

iamserjo/mermaid-php
====================

Mermaid.js generator for php

1.0.2(1y ago)08MITPHPPHP ^8.1

Since May 20Pushed 1y agoCompare

[ Source](https://github.com/iamserjo/mermaid-php)[ Packagist](https://packagist.org/packages/iamserjo/mermaid-php)[ Docs](https://github.com/jonaspardon/mermaid-php)[ RSS](/packages/iamserjo-mermaid-php/feed)WikiDiscussions main Synced today

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

Mermaid.js generator for php
============================

[](#mermaidjs-generator-for-php)

[![Latest Version on Packagist](https://camo.githubusercontent.com/46d7b5742df590e58f6197de2cc19f2636fc6ebaf6bf7730172a620b53878814/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6f6e6173706172646f6e2f6d65726d6169642d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jonaspardon/mermaid-php)[![GitHub Tests Action Status](https://camo.githubusercontent.com/80f09e70efb7b3487b38ab55bba3c583671258b200011cbd27956efb9b2f1098/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6a6f6e6173706172646f6e2f6d65726d6169642d7068702f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/jonaspardon/mermaid-php/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/248f5a834f488e24423808bca4450fcc352ec8e6ee29f6f95aeae3d2fa20b6ca/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6a6f6e6173706172646f6e2f6d65726d6169642d7068702f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/jonaspardon/mermaid-php/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/c5bdd7dc10cbe854bf040b5122c4868d3558e8dd658f81c07c02c7e4561bcaf4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6f6e6173706172646f6e2f6d65726d6169642d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jonaspardon/mermaid-php)

Generate mermaid.js flowcharts with php.

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

[](#installation)

You can install the package via composer:

```
composer require jonaspardon/mermaid-php
```

Usage
-----

[](#usage)

```
$graph = new Graph(new GraphDirection(GraphDirection::LEFT_TO_RIGHT));

$from = new Node(
    identifier: 'A',
    title: 'This package',
    shape: new NodeShape(NodeShape::ROUND_EDGES),
    style: new Style(
        backgroundColor: '#16a085',
        fontColor: '#ffffff',
        borderColor: '#333333',
    ),
);

$to = new Node(
    identifier: 'B',
    title: 'Your application',
    shape: new NodeShape(NodeShape::HEXAGON),
    style: new Style(
        backgroundColor: '#55efc4',
        fontColor: '#000',
        borderColor: '#333333',
    ),
);

$link = new Link($from, $to);

$output = $graph->addNode($from)
    ->addNode($to)
    ->addLink($link)
    ->render();
```

 ```
flowchart LR;
A("This package");
style A fill:#16a085,stroke:#333333,stroke-width:1px,color:#ffffff;
B{{"Your application"}};
style B fill:#55efc4,stroke:#333333,stroke-width:1px,color:#000;
A-->B;
```

      Loading ```
flowchart LR;
A("This package");
style A fill:#16a085,stroke:#333333,stroke-width:1px,color:#ffffff;
B{{"Your application"}};
style B fill:#55efc4,stroke:#333333,stroke-width:1px,color:#000;
A-->B;

```

Testing
-------

[](#testing)

```
composer test
```

Used by
-------

[](#used-by)

- [Laravel Event Visualizer](https://github.com/JonasPardon/laravel-event-visualizer) - a Laravel package to visualize your application's events and handlers

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Jonas Pardon](https://github.com/JonasPardon)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance46

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

409d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/40b5d140750aa6d7867f9f476c3aae745552f386513f0e97ec84dfb8ff863edb?d=identicon)[iamserjo](/maintainers/iamserjo)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (16 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (11 commits)")[![iamserjo](https://avatars.githubusercontent.com/u/3052219?v=4)](https://github.com/iamserjo "iamserjo (2 commits)")[![JonasPardon](https://avatars.githubusercontent.com/u/10206461?v=4)](https://github.com/JonasPardon "JonasPardon (2 commits)")[![pieterclaerhout](https://avatars.githubusercontent.com/u/74731?v=4)](https://github.com/pieterclaerhout "pieterclaerhout (2 commits)")

---

Tags

laravelJonasPardonmermaid-php

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/iamserjo-mermaid-php/health.svg)

```
[![Health](https://phpackages.com/badges/iamserjo-mermaid-php/health.svg)](https://phpackages.com/packages/iamserjo-mermaid-php)
```

###  Alternatives

[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329530.5k29](/packages/codewithdennis-filament-select-tree)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

124603.0k](/packages/worksome-exchange)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[tarfin-labs/event-machine

Event-driven state machines for Laravel with event sourcing, type-safe context, and full audit trail.

199.4k](/packages/tarfin-labs-event-machine)[tapp/filament-form-builder

User facing form builder using Filament components

132.4k3](/packages/tapp-filament-form-builder)

PHPackages © 2026

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