arqel-dev/workflow

Define and enforce state machines for Laravel Eloquent;models with explicit transitions and centralized authorization via WorkflowDefinition and HasWorkflow.

2|Updated Apr 17, 2026
One-click install
npx skills add https://github.com/arqel-dev/arqel --skill arqel-dev-workflow
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: arqel-dev/workflow
Source: https://github.com/arqel-dev/arqel/tree/main/packages/workflow
Command: npx skills add https://github.com/arqel-dev/arqel --skill arqel-dev-workflow

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a structured, auditable state-machine framework for Eloquent models, enabling well-defined states, transitions, and centralized authorization and history.

Core Features & Use Cases

  • Centralized workflow metadata via WorkflowDefinition and HasWorkflow for models.
  • Deterministic transitions with optional Spatie integration, event-based auditing, and append-only history.
  • Guardrails for authorization, fallback paths, and morph-map friendly persistence.

Quick Start

Define a model with HasWorkflow, register a WorkflowDefinition with states and transitions, then call transitionTo() to move between states.

Frequently Asked Questions about arqel-dev/workflow

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement a state machine for Laravel Eloquent models?

A state machine for Laravel Eloquent models enforces deterministic transitions by defining explicit states and a centralized WorkflowDefinition, preventing invalid state changes and ensuring model lifecycle integrity.

How do I track model history and audit state transitions in Laravel?

To track model history and audit state transitions in Laravel, the framework records every change in an append-only history log with event-based auditing, ensuring a tamper-proof record of all state changes.

Can I use Spatie authorization with a Laravel state machine workflow?

Yes, you can integrate Spatie authorization with a Laravel state machine workflow. The framework offers centralized authorization guardrails with optional Spatie integration to control permissions for specific transitions.

Does Laravel workflow state machine support fallback paths and UI metadata?

Yes, the Laravel workflow state machine supports fallback paths for transitions and exposes UI-ready metadata. This allows frontend applications to dynamically render state buttons and transition logic without hardcoding.

What is the best way to authorize Eloquent model transitions in Laravel?

The best way to authorize Eloquent model transitions in Laravel is through a centralized workflow definition that enforces guardrails, providing optional Spatie integration to validate user permissions before allowing transitionTo() execution.