Search by

javaabu / workflows

dash8xjavaabun4ff4h

Dynamic workflows for Laravel: versioned workflow definitions with steps, transitions, assignees and conditions, instances with tasks, history and events, fluent definitions you can seed, a keyboard-accessible drag-and-drop builder in Inertia React and Blade, developer-defined actions, step data col

Package info

github.com/Javaabu/workflows

pkg:composer/javaabu/workflows

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 2

dev-main / 1.x-dev 2026-11-10 09:59 UTC

This package is auto-updated.

Last update: 2026-11-15 10:55:46 UTC


README

Tests codecov Latest Version on Packagist License: MIT

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.