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 Fsm Laravel Package

christhompsontldr/laravel-fsm

Robust finite state machine for Laravel with zero-config setup. Define states and transitions with guards, actions, and entry/exit callbacks. Event-driven with comprehensive transition logging, validation, caching, and support for multiple state machines per model column.

View on GitHub
Deep Wiki
Context7
v1.0.5

What's new

  • Fsm\Contracts\FsmEventEnum — new marker interface (extends \BackedEnum) for typing FSM event identifiers, mirroring the existing FsmStateEnum pattern. Implementations are string-backed enums whose ->value is the wire identifier.
  • Widened APIs: HasFsm::trigger(), HasFsm::can(), HasFsm::dryRun(), TransitionBuilder::event(), and TransitionBuilder::on() now accept FsmEventEnum|string. Internal storage stays string; the union is at the public boundary only.

Usage

enum CheckoutEvent: string implements FsmEventEnum {
    case Submit = 'submit';
    case Complete = 'complete';
}

\$cart->fsm()->trigger(CheckoutEvent::Submit);   // typed
\$cart->fsm()->trigger('submit');                // still works

Why marker-only (no required methods)?

Events are programmatic identifiers, not user-facing values, so no `displayName()`/`icon()` analog to `FsmStateEnum`. The interface extends `\BackedEnum` so the type system enforces backed-enum-only at parse time and `->value` is statically guaranteed to exist.

Back-compat

100% back-compat with v1.0.4. Existing string callers continue to work unchanged.

Tests

3 new tests in `HasFsmEventEnumTest` confirm enum and string callers produce identical FSM behavior. Full Pest suite passes (one pre-existing test mutation flake on main is unrelated).

v1.0.4

What's Changed

Full Changelog: https://github.com/ChrisThompsonTLDR/laravel-fsm/compare/v1.0.3...v1.0.4

v1.0.3
v1.0.2
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.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope