javaabu/workflows
| Install | |
|---|---|
composer require javaabu/workflows:v1.0.0-alpha.1 |
|
| Latest Version: | v1.0.0-alpha.1 |
| PHP: | ^8.4 |
| Laravel: | 12 · 13 |
| License: | MIT |
| Last Updated: | Nov 24, 2026 |
| Links: | GitHub · Packagist |
Workflows
Dynamic workflows for Laravel: leave requests, purchase approvals, applications, anything that goes through steps where people decide what happens next.
- Definitions with steps (start, task, decision, action, end), transitions, assignees and conditions, versioned: instances stay on the version they started with.
- Instances with tasks, an inbox per user, a full history and events.
- Fluent definitions for seeders, idempotent and lockable to code.
- A visual builder: drag, connect and edit steps, all by keyboard too, in Inertia React and Blade.
- Actions: notify (javaabu/notifications), update the record, call a webhook, set data, or your own.
- Step data with javaabu/form-builder forms.
- A tester that shows the path a run takes with sample data, and an optional laravel/ai assistant that designs workflows.
- Permissions through javaabu/permissions for any guard and user model. Optional javaabu/translatable. Dhivehi and RTL.
use Javaabu\Workflows\Definitions\Assignee;
use Javaabu\Workflows\Definitions\Step;
use Javaabu\Workflows\Definitions\Transition;
use Javaabu\Workflows\Facades\Workflows;
Workflows::define('leave-request')
->name(['en' => 'Leave request', 'dv' => 'ޗުއްޓީގެ އެދުން'])
->for(LeaveRequest::class)
->steps([
Step::start()->form('leave-request'),
Step::task('review')->assignTo(Assignee::subject('manager'))->runs('notify', ['to' => [['type' => 'assignees']], 'title' => 'A leave request to review']),
Step::end('approved')->runs('update_model', ['attributes' => ['status' => 'approved']]),
Step::end('rejected'),
])
->transitions([
Transition::make('submit')->from('start')->to('review'),
Transition::make('approve')->from('review')->to('approved')->label('Approve')->color('success'),
Transition::make('reject')->from('review')->to('rejected')->label('Reject')->color('danger')->requireComment()->skipForm(),
])
->sync();
// routes/web.php
Route::workflows(['guard' => 'web_admin', 'prefix' => 'admin/workflows', 'name' => 'admin.workflows']);
Route::workflowTasks(); // /tasks
// anywhere
$instance = $leave->startWorkflow('leave-request', by: $request->user(), data: $request);
$instance->transition('approve', by: $manager, comment: 'ރަނގަޅު');
Documentation
The docs are in docs/, indexed for assistants in llms.txt.
Testing
composer test
pnpm test
Changelog
See CHANGELOG.
Contributing
See CONTRIBUTING.
Security
If you discover a security issue, email info@javaabu.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). See License File for more information.
Related Packages
Dynamic forms for Laravel: versioned form definitions and entries in the databas...
Fluent form schemas for Laravel: define a form once in PHP and render it with Bl...
Fluent bulk actions for Laravel: each authorized through the Gate with can(), op...
WordPress classic-style widgets for Laravel: widget classes with javaabu/stencil...
Version History
Pre-releases (1)
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v1.0.0-alpha.1 | ^8.4 | ^12.0 || | MIT |