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

webrek/laravel-state-machine

View on GitHub
Deep Wiki
Context7
1.2.0

Added

  • Laravel 13 support. The package now installs on Laravel 12 and 13 (PHP 8.2+).
1.1.0

Added

  • Transition effects via Transition::using($closure) that run inside the same database transaction as the state change and history record — if the effect throws, the whole transition rolls back (and the in-memory state is reverted).
  • StateMachine::toMermaid() / StateMachineHandler::toMermaid() to render the machine as a Mermaid stateDiagram-v2.
  • state-machine:diagram artisan command to print a definition's diagram.

Changed

  • apply() now wraps the state change, effect and history in a single database transaction.
1.0.0

Added

  • Declarative StateMachine definitions: states, transitions and an initial state, validated on use.
  • Transition builder with multiple source states, a target, and an optional guard closure.
  • HasStateMachines trait that seeds the initial state on create and exposes a stateMachine() handler with state(), is(), can(), allowed(), canTransitionTo() and apply().
  • StateTransitioning and StateTransitioned events.
  • Optional transition history with a publishable migration and history() query.
  • Dedicated exceptions for unknown transitions, disallowed transitions, failed guards and invalid definitions.
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.
roundly-consulting/kubernetes-api-for-laravel
roundly-consulting/plausible-for-laravel
gvp/gvp-laravel-template
metasyncsite/laravel-metasync-client
roundly-consulting/onboarding-for-laravel
andydefer/laravel-notification
adachsoft/cli-process-tester
jhaskell13/laraflow
sebastienheyd/boilerplate-media-manager
ccast/tagixo-primix
pretendtrue/laravel-builder
sawmainek/laravel-scout-tntsearch-driver
tomshaw/laravel-calendar-table
dibakar/laravel-ownership
steadrun/laravel-monitor
labyrinthe/connect-laravel
elmogy/layan
drewdan/sentinel-client
dskripchenko/laravel-llm
fatryst/nuonuo