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.
codraw/framework-extra-bundle
codraw/messenger
codraw/security
codraw/mailer
codraw/contracts
codraw/profiling
codraw/dependency-injection
codraw/tester
codraw/core
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