Weave Code
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.
codraw/graphviz
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata