Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel State Machine Laravel Package

jobmetric/laravel-state-machine

jobmetric/laravel-state-machine adds finite state machines to Laravel applications. Define states and transitions for Eloquent models, enforce guards, trigger events and callbacks, and manage safe state changes with a clean, configurable API.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Feature development: Enables declarative state machines for Eloquent models (e.g., order status, user lifecycle, approval workflows), reducing custom status logic and associated bugs.
  • Roadmap acceleration: The new state-machine:debug command and methods to fetch current state and all transitions improve developer productivity and testability, shortening feedback loops for workflow-heavy features.
  • Build vs. buy: A lightweight, Laravel-native alternative to building a state machine from scratch or adopting heavier BPMN engines. PHPDoc support in the stub improves IDE autocompletion and maintainability, lowering total cost of ownership.
  • Use cases: Order processing, subscription management, content moderation, multi-step approvals, and any domain where entities move through defined states with guarded transitions.

When to Consider This Package

  • Adopt when: Your Laravel app has models requiring clear state transitions with rules, guards, and actions; you want a declarative, testable approach that integrates with Eloquent; you need visibility into transitions for debugging (new debug command) or introspection (get current state / all transitions).
  • Look elsewhere when: You need a full BPMN engine, complex parallel/hierarchical states, a visual workflow editor, or state machines not tied to Eloquent models. Also consider alternatives if you require built-in audit trails or event sourcing beyond what this package offers.

How to Pitch It (Stakeholders)

  • Executives: This package speeds delivery of workflow-driven features by providing a proven, low-maintenance state machine implementation. The 2.4.0 release adds debugging and introspection tools that reduce support burden and improve reliability, while updated testbench compatibility keeps the package aligned with Laravel’s testing ecosystem.
  • Engineering: Offers a clean, declarative API for defining state machines on Eloquent models. New in 2.4.0: enhanced PHPDoc in the stub for better IDE support, methods to retrieve the current state and all transitions for a field, and a state-machine:debug console command for inspecting transition information—backed by new test coverage. Composer adjustments ensure compatibility with the latest orchestra/testbench version.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log