Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Mermaid Php Laravel Package

jonaspardon/mermaid-php

Generate Mermaid diagrams from PHP with a fluent API. Build flowcharts, sequence diagrams, and more as strings for docs, dashboards, or Markdown—no JavaScript required.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Documentation automation: generate Mermaid diagram source (flowcharts, sequence, class, ER, state) directly from PHP — useful for keeping architecture docs, onboarding guides, and ADRs in sync with code instead of hand-drawn diagrams that rot.
  • Model/ERD introspection as a product feature: walk Eloquent models and relationships, emit an ER diagram into an internal admin panel or developer portal. This is a genuinely differentiating "developer experience" feature that's expensive to build from scratch.
  • Build vs. buy: buying (adopting) is clearly favored. The package is a thin DSL builder over the Mermaid syntax — low surface area, small dependency, and the hard part (parsing/layout/rendering) lives in Mermaid.js, not here. Building your own string builder is wasted effort; building your own renderer is a different, far larger project.
  • Roadmap input: treat this as enabling infrastructure for docs-as-code, CI-generated diagrams, and exportable reports (e.g., "download diagram as .mmd / PNG"), not as a standalone user-facing product.
  • Use cases that fit well: CI job that regenerates diagrams on merge; changelog/architecture pages; support for "explain this schema/workflow" tooling; customer-facing process diagrams generated per-tenant.
  • Important scope note: this package produces Mermaid text, not images. Product decisions about rendered output (PNG/SVG export, in-app previews) require a renderer (Mermaid CLI, Kroki, or client-side Mermaid.js) — budget for that separately.

When to Consider This Package

Consider it when:

  • You're on PHP 8.x with Laravel 10/11 — v1.0.1 explicitly adds Laravel 11 support, removing the main version-compatibility blocker for modern stacks.
  • You want diagrams generated from code (models, workflows, service graphs) and stored as diffable text alongside the codebase.
  • You need only diagram authoring — the rendering step is already solved in your stack (browser, docs site, or a CLI/Kroki service).
  • You value a small, single-purpose dependency over a heavyweight diagramming library.

Look elsewhere when:

  • You need server-side image generation with no external renderer; use Mermaid CLI / Kroki / a headless-browser pipeline instead.
  • You need diagram types or layout control Mermaid doesn't offer (large-scale graph layout, custom styling beyond Mermaid themes).
  • You need interactive diagram editing/visual authoring — this is a code-first builder, not an editor.
  • You're not on PHP/Laravel, or you're pinned to an older Laravel major and can't move.

Adoption hygiene: v1.0.1 is a patch-level maintenance release (one PR adding Laravel 11 + a new contributor). No breaking changes, no API changes. Still pre-2.0, so pin the version and wrap it behind a small internal adapter so a future Mermaid-syntax or API change is a one-file fix.

How to Pitch It (Stakeholders)

For executives: This is a low-risk, small-footprint dependency that lets us generate technical diagrams from our code rather than paying people to redraw them. The v1.0.1 release adds Laravel 11 support, which means it now fits our current stack — no version lock-in, no fork. Cost is negligible; the payoff is documentation that stays accurate as the system changes, plus a credible "auto-generated schema/architecture view" for onboarding and internal tooling.

For engineering: It's a composer-installable Mermaid DSL builder — you compose nodes and edges in PHP and get Mermaid text out. Output is plain text, so it diffs in git, tests cleanly, and slots into CI to regenerate docs on merge. It does not render images; pair it with Mermaid CLI or Kroki for PNG/SVG, or render client-side. v1.0.1 is a compatibility patch (Laravel 11), no breaking changes — pin the version and keep it behind a thin adapter, since we're still on a 1.x line.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect