The state machine is a flexible library that helps you move Eloquent models from States through Transitions while emitting events along the way.
Let's say we have a Cat, who does two things, being
In order to become Awake from his initial state being Asleep, the cat has to
Now if we look at the state machine definition we can see the above is perfectly mapped out.
composer require hyn/state-machine
Read more about installation and configuration on state-machine.readme.io.
Run the tests with:
vendor/bin/phpunit