Laravel Exportsymflow-laravelMIT License

Design visually, run in Laravel

Build your workflow in SymFlowBuilder, export a symflow-laravel compatible PHP config, and drop it into your Laravel project. Zero manual configuration.

Three steps to production PHP

01

Design your workflow

Build states, transitions, guards, and metadata in the visual editor. No PHP needed yet.

02

Export as PHP

Open Export, choose "PHP (Laravel)", and copy or download the generated file.

03

Drop into Laravel

Place it in your Laravel config directory and register with symflow-laravel. Done.

What you get in the PHP export

symflow-laravel Compatible

Generates a PHP config file built from symflow-laravel's data classes: WorkflowDefinition, Place, Transition, and WorkflowMeta.

Guard Expressions

Guards from the visual editor are emitted directly onto each transition's guard property. Access control built in.

AND / OR Patterns

Model parallel forks (AND-split), synchronization (AND-join), and exclusive choices (OR) visually. Multi-from and multi-to transitions survive the PHP export intact.

Weighted Arcs

Set consume and produce weights for advanced Petri-net modeling. Weights flow through to the PHP config automatically.

Type-Safe Enums

Uses PHP enums for workflow type (WorkflowType::StateMachine, WorkflowType::Workflow) and marking store type (MarkingStoreType::Method, MarkingStoreType::Property).

Validate Before Export

Catch unreachable states, dead transitions, and structural errors in the editor — before they become runtime bugs in Laravel.

Round-Trip Workflow

Import existing Symfony YAML, edit visually, export as Laravel PHP config. Migrate between frameworks without rewriting by hand.

Zero Manual Config

The exported file is complete — imports, definition, metadata, and marking store. Drop it into your Laravel project and register it.

Example exported config

Actual SymFlowBuilder output for a simple order workflow with guards. Drop it straight into your Laravel project.

config/workflows/order.php
<?php

// Generated by symflow

use Laraflow\Data\Place;
use Laraflow\Data\Transition;
use Laraflow\Data\WorkflowDefinition;
use Laraflow\Data\WorkflowMeta;
use Laraflow\Enums\MarkingStoreType;
use Laraflow\Enums\WorkflowType;

return [
    'definition' => new WorkflowDefinition(
        name: 'order',
        type: WorkflowType::StateMachine,
        places: [
            new Place(name: 'draft'),
            new Place(name: 'submitted'),
            new Place(name: 'approved'),
            new Place(name: 'fulfilled'),
        ],
        transitions: [
            new Transition(
                name: 'submit',
                froms: ['draft'],
                tos: ['submitted'],
            ),
            new Transition(
                name: 'approve',
                froms: ['submitted'],
                tos: ['approved'],
                guard: 'is_granted("ROLE_ADMIN")',
            ),
            new Transition(
                name: 'fulfill',
                froms: ['approved'],
                tos: ['fulfilled'],
            ),
        ],
        initialMarking: ['draft'],
    ),
    'meta' => new WorkflowMeta(
        name: 'order',
        type: WorkflowType::StateMachine,
        markingStore: MarkingStoreType::Method,
        initialMarking: ['draft'],
        supports: 'App\\Models\\Order',
        property: 'status',
    ),
];

Exported config includes

WorkflowDefinition
WorkflowMeta
Place data objects
Transition data objects
Guard expressions
WorkflowType enum
MarkingStoreType enum
Initial marking
Supports (model class)
Marking store property
Weighted arcs
Metadata

Design visually, run in Laravel

Build the workflow on a canvas, export a symflow-laravel compatible PHP config, and register it in your Laravel project. No manual YAML-to-PHP translation.