Laravel Exportsymflow-laravelMIT License

Design visually, run in Laravel

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

Three steps to production PHP

01

Design your workflow

Use the visual editor to create states, transitions, guards, and metadata. No PHP needed yet.

02

Export as PHP

Click Export, select "PHP (Laravel)", and copy or download the generated config file.

03

Drop into Laravel

Place the file in your Laravel project's config directory and register it with symflow-laravel. Done.

What you get in the PHP export

symflow-laravel Compatible

Exports a ready-to-use PHP config file using symflow-laravel's data classes: WorkflowDefinition, Place, Transition, and WorkflowMeta.

Guard Expressions

Guard expressions configured in the visual editor are exported directly into the transition's guard property. Access control built in.

AND / OR Patterns

Model parallel forks (AND-split), synchronization (AND-join), and exclusive choices (OR) visually. The PHP export preserves multi-from and multi-to transitions.

Weighted Arcs

Configure consume and produce weights on transitions for advanced Petri net modeling. Weights are exported 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 visual editor before exporting. Ship valid configs every time.

Round-Trip Workflow

Import your existing Symfony YAML, edit visually in SymFlowBuilder, then export as Laravel PHP config. Migrate workflows between frameworks effortlessly.

Zero Manual Config

The exported PHP file is complete — includes imports, definition, metadata, and marking store config. Copy the file into your Laravel project and register it.

Example exported config

This is the actual output from SymFlowBuilder for a simple order workflow with guards. Copy it directly 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 your workflow in SymFlowBuilder, export it as a symflow-laravel compatible PHP config, and register it in your Laravel project. No manual YAML-to-PHP translation.