Overview
DBFlow is a model-first approval workflow engine for Laravel and Filament. It attaches approvals, workflow tasks, reject flows, and audit trails to your Eloquent models.
This documentation covers Core (dbflowlabs/core), Filament Standard (dbflowlabs/filament), and Pro (dbflowlabs/filament-pro) where noted.
Alpha notice: Pin exact package tags for production.
dbflowlabs/coreanddbflowlabs/filamentare on Packagist.
Quick start
- Install Core — Composer install and migrations
- Build Your First Workflow — refund approval walkthrough
- Add HasWorkflow — trait on your model
- Start a workflow —
DBFlow::start()from a business action - Approve / reject — task handling and reject strategies
- View timeline — audit history in Filament
Optional: Try Live Demo — no local install required.
How DBFlow works
- Eloquent model — your domain record
- Workflow definition — steps, transitions, assignees
- Workflow instance — a run on that record
- Pending task — waiting for an approver
- Approve or reject —
DBFlow::approve()/reject() - Business continues — status updates via
WorkflowHooksor your logic
Workflow state lives in dbflow_workflow_* tables. Your application keeps business logic.
Layers: Core runs workflows → Filament provides UI → Pro visual builder (preview). See Architecture.
Maturity
DBFlow is in public alpha. Before production use:
Learning paths
Laravel developers
- Eloquent models —
HasWorkflowtrait - Code-defined workflows — JSON definitions and sync
- Build Your First Workflow
- Workflow Hooks — host status mapping
- Testing Workflows — PHPUnit patterns
Host wiring (providers, resolvers, guards): Host Integration.
Filament developers
- Filament UI — install and register the panel
- Filament Resource Actions — start from resources
- My Tasks — approval inbox
- Workflow Timeline — instance history
Walkthroughs: Refund Approval · Purchase Request.
Visual builder (preview)
Pro is in Early Access at $129/year (Creem). Core executes workflows; Pro helps design definitions.
Advanced topics
- Conditions — transition routing
- Reject Strategies —
RejectStrategymatrix - Permissions —
PermissionCheckercontracts - Host Integration — providers, resolvers, sync
- Host Reference Patterns — ERP-style patterns
- Architecture — DAG execution, concurrency, hooks
Reference
Install snippet
Requirements: PHP 8.3+, Laravel 13+, Composer 2+
composer require dbflowlabs/core
php artisan vendor:publish --tag=dbflow-migrations
php artisan migrate
use DbflowLabs\Core\Traits\HasWorkflow;
class Refund extends Model
{
use HasWorkflow;
}