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.
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.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.enum CheckoutEvent: string implements FsmEventEnum {
case Submit = 'submit';
case Complete = 'complete';
}
\$cart->fsm()->trigger(CheckoutEvent::Submit); // typed
\$cart->fsm()->trigger('submit'); // still works
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.
100% back-compat with v1.0.4. Existing string callers continue to work unchanged.
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).
Full Changelog: https://github.com/ChrisThompsonTLDR/laravel-fsm/compare/v1.0.3...v1.0.4
Full Changelog: https://github.com/ChrisThompsonTLDR/laravel-fsm/compare/v1.0.2...v1.0.3
Full Changelog: https://github.com/ChrisThompsonTLDR/laravel-fsm/compare/v1.0.1...v1.0.2
Full Changelog: https://github.com/ChrisThompsonTLDR/laravel-fsm/compare/v1.0.0...v1.0.1
Full Changelog: https://github.com/ChrisThompsonTLDR/laravel-fsm/commits/v1.0.0
How can I help you explore Laravel packages today?