webrek/laravel-state-machine
Transition::using($closure) that run inside the same database transaction as the state change and history — if the effect throws, the whole transition rolls back (and in-memory state is reverted).toMermaid() on the definition and handler, plus a state-machine:diagram artisan command, to render the machine as a Mermaid stateDiagram-v2.apply() now wraps the state change, effect and history in one transaction.First stable release.
Declarative state machines for Eloquent models:
StateMachine definitions (states, transitions, initial state), validated on use.Transition builder with multiple source states and optional guards.HasStateMachines trait: seeds the initial state and exposes can / allowed / apply / history.StateTransitioning and StateTransitioned events.Requires PHP 8.2+ and Laravel 12.
How can I help you explore Laravel packages today?