Search by

lucassdoro / filament-flowpilot

lucassdoro

Draw flowcharts, org charts and family trees inside Filament forms with the full draw.io editor, served from your own app.

Package info

github.com/lucassdoro/filament-flowpilot

pkg:composer/lucassdoro/filament-flowpilot

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.1 2026-12-01 02:39 UTC

This package is auto-updated.

Last update: 2026-12-01 12:16:33 UTC


README

FlowPilot

Latest Version on Packagist Tests Total Downloads License

FlowPilot

The full draw.io editor as a Filament form field, served from your own app.

FlowPilot lets your users draw flowcharts, decision trees, org charts, family trees or any other diagram inside a Filament form. The diagram is saved on the record as an SVG with the drawing embedded, so it can be shown anywhere and opened again for editing. The editor runs from your public directory, and nothing is sent to an outside server.

Diagram shown on a record

Features

  • DiagramEditor form field that opens draw.io in a full-screen overlay, with every shape library, template and export it ships with.
  • DiagramEntry infolist entry that shows the saved diagram.
  • One text column per diagram. The stored SVG keeps the editable drawing inside it.
  • Self-hosted editor installed by an artisan command, pinned to a release and verified by checksum.
  • Follows the panel's dark mode and the app locale.
  • Multiple pages per diagram, all kept when the record is saved.
  • Previews are rendered as images, so scripts inside an SVG never run.
  • English and Brazilian Portuguese translations.

Editing a diagram

Requirements

  • PHP 8.2 or higher (8.3 for Laravel 13) with the zip extension
  • Laravel 11, 12 or 13
  • Filament 4.13 or higher, or Filament 5

Installation

composer require lucassdoro/filament-flowpilot

Download the editor into public/vendor/flowpilot/drawio (about 140 MB unpacked) and publish the Filament assets:

php artisan flowpilot:install
php artisan filament:assets

Run flowpilot:install again during deployment, or commit the folder. The command does nothing when the configured version is already installed. Add the folder to .gitignore if you install it on deploy:

/public/vendor/flowpilot

With zero-downtime deploys that create a new release folder each time (Envoyer, Deployer, Forge), keep public/vendor/flowpilot in a shared folder and symlink it into each release, so the editor is downloaded once instead of on every deploy.

Usage

Add a text column for the diagram. SVG files grow with the drawing, so use longText on MySQL:

$table->longText('diagram')->nullable();

Add the field to a form:

use LucasDoro\FlowPilot\Forms\Components\DiagramEditor;

public static function configure(Schema $schema): Schema
{
    return $schema->components([
        TextInput::make('name')->required(),
        DiagramEditor::make('diagram')->columnSpanFull(),
    ]);
}

And show it on a view page:

use LucasDoro\FlowPilot\Infolists\Components\DiagramEntry;

DiagramEntry::make('diagram')->columnSpanFull();

Users click Draw diagram, draw, and press Save & Exit. The record is saved when the form is submitted, like any other field.

Preview height

Both components show the diagram scaled to fit, up to 320 pixels tall by default:

DiagramEditor::make('diagram')->previewHeight(480);

Using the diagram elsewhere

The state is a plain SVG string. To show it in your own Blade views, render it as an image instead of printing it, so any script inside the file stays inert:

<img src="{{ \LucasDoro\FlowPilot\Diagram::toDataUri($process->diagram) }}" alt="">

The SVG can also be opened in the desktop draw.io app or on diagrams.net, because the drawing is stored inside it.

Configuration

Publishing the config is optional:

php artisan vendor:publish --tag=flowpilot-config
return [
    'version' => env('FLOWPILOT_DRAWIO_VERSION'),
    'checksum' => env('FLOWPILOT_DRAWIO_CHECKSUM'),
    'download_url' => 'https://github.com/jgraph/drawio/releases/download/v{version}/draw.war',
    'path' => 'vendor/flowpilot/drawio',
    'url' => env('FLOWPILOT_EDITOR_URL'),
    'stealth' => env('FLOWPILOT_STEALTH', true),
];

With version empty, flowpilot:install uses the draw.io release this version of FlowPilot was tested with, and package updates bring newer releases. To pin another release, set its version and the SHA-256 of its draw.war, then run the command again:

FLOWPILOT_DRAWIO_VERSION=32.7.10
FLOWPILOT_DRAWIO_CHECKSUM=104ca6c64479a0306b9e0d6c53df1e6f76de287758bd616b1cb0d2c29ae95ac3

The command refuses to install without a checksum unless you pass --no-verify. It also refuses to replace a folder it did not install.

To skip the local install and load the editor from your own draw.io server, or from the public embed service, set the URL:

FLOWPILOT_EDITOR_URL=https://embed.diagrams.net

The field needs nothing else. With the public service, diagrams are still saved only on your records, but the editor itself loads from diagrams.net.

Stealth mode and templates

By default the editor runs in draw.io's stealth mode, which keeps it from reaching any outside server. Stealth mode also hides the template gallery. To show it:

FLOWPILOT_STEALTH=false

The templates ship with the editor, so the gallery itself loads from your server. With stealth off, a few optional features, such as Google Fonts or images inserted by URL, can load from outside when a user picks them.

Content Security Policy

If your app sends a Content Security Policy, allow the editor in frame-src (your own origin, or the host in FLOWPILOT_EDITOR_URL) and data URIs in img-src for the previews. Otherwise the editor and the previews stay blank.

What works in the editor

Everything draw.io does locally: every shape library, styles, layers, multiple pages, automatic layouts, Mermaid import, exporting to PNG, JPEG, SVG and XML, and printing, which also covers saving as PDF from the browser. Features that depend on draw.io's own cloud, such as saving to Google Drive or real-time collaboration, are not available, because the diagram is saved on your record instead.

Translations

php artisan vendor:publish --tag=flowpilot-translations

The draw.io interface uses the app locale. Regional locales fall back to the language draw.io ships, such as es for es_ES, except pt_BR and zh_TW, which draw.io translates separately.

Testing

composer test

Changelog

See CHANGELOG.md.

Contributing

See CONTRIBUTING.md.

Security

Previews are rendered as images, so scripts inside a stored SVG never run in your panel. The editor itself runs in an iframe on your own domain, as draw.io needs to read its files. If users you do not trust can save diagrams that your admins later open, serve the editor from a separate subdomain or your own draw.io server and point FLOWPILOT_EDITOR_URL at it, so a flaw in draw.io cannot reach the panel's session.

To report a vulnerability, see SECURITY.md.

Credits

  • Lucas Dóro
  • The editor is draw.io by JGraph, under the Apache 2.0 license. FlowPilot downloads it on install and does not redistribute it. draw.io is a trademark of JGraph Ltd, and FlowPilot is not affiliated with or endorsed by JGraph.

License

The MIT License (MIT). See LICENSE.md.