jobmetric/laravel-state-machine
jobmetric/laravel-state-machine adds finite state machines to Laravel applications. Define states and transitions for Eloquent models, enforce guards, trigger events and callbacks, and manage safe state changes with a clean, configurable API.
state-machine.php.stub first; in 2.4.0 this stub carries improved PHPDoc and is the best reference for expected state/transition shapes and generated class structure.php artisan state-machine:debug to inspect registered transitions and current state information before wiring UI or API endpoints.First practical use case: a model with a status field, such as Order or Invoice, where transitions like pending -> paid -> shipped need centralized guards, actions, and inspection for admin UI buttons.
state-machine:debug as a local/staging troubleshooting tool when a transition is unexpectedly unavailable; compare registered transitions with the model’s current field state.orchestra/testbench version change is development/test infrastructure only; it should not affect production runtime behavior.How can I help you explore Laravel packages today?