spatie/laravel-model-states
Add state and state machine behavior to Laravel Eloquent models. Represent each state as a class, automatically serialize to/from the database, and perform clean, explicit transitions with configurable rules—ideal for workflows like payments, orders, and approvals.
When a transition is successfully performed, an event will be dispatched called \Spatie\ModelStates\Events\StateChanged. This event hold references to the initial state (initialState), the new state (finalState), the transition class that performed the transition (transition), the model that the transition was performed on (model) and the field name that was transitioned (field).
How can I help you explore Laravel packages today?