Design Workflows Visually, Run Them in Laravel with symflow-laravel
Laravel Joins the Export Family
SymFlowBuilder has always been about bridging the gap between visual design and production config. Today we are adding a new export target: PHP for Laravel.
Click the export dropdown, choose PHP (Laravel), and you get a ready-to-use config file for symflow-laravel — a Symfony-compatible workflow engine for Laravel.
What is symflow-laravel?
symflow-laravel is a Laravel package that brings Symfony's Workflow component semantics to Laravel applications. It supports state machines, Petri nets, guards, events, validation, weighted arcs, and middleware.
Install it with Composer:
composer require vandetho/symflow-laravelWhat the Export Looks Like
Here is a real export from SymFlowBuilder for a simple order workflow:
<?php
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'),
],
transitions: [
new Transition(
name: 'submit',
froms: ['draft'],
tos: ['submitted'],
),
new Transition(
name: 'approve',
froms: ['submitted'],
tos: ['approved'],
guard: 'is_granted("ROLE_ADMIN")',
),
],
initialMarking: ['draft'],
),
'meta' => new WorkflowMeta(
name: 'order',
type: WorkflowType::StateMachine,
markingStore: MarkingStoreType::Method,
initialMarking: ['draft'],
supports: 'App\\Models\\Order',
property: 'status',
),
];No manual translation from YAML to PHP. No copy-pasting place names. The file is complete with imports, type-safe enums, and your guard expressions.
What is Included
The PHP export covers everything you configure in the editor:
- WorkflowDefinition with places, transitions, and initial marking
- Guard expressions on transitions
- WorkflowType enum (StateMachine or Workflow)
- MarkingStoreType enum (Method or Property)
- Supports (your model class)
- Weighted arcs (consume and produce weights)
- Metadata on places and transitions
Three Steps
- Design your workflow in the editor
- Click Export and choose PHP (Laravel)
- Drop the file into your Laravel project's config directory
See the full Laravel integration guide for details.