Skip to content

The hyn state machine package is a flexible library that helps you move Eloquent models from States through Transitions while emitting events along the way.

Notifications You must be signed in to change notification settings

hyn/state-machine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

89e3b30 · Feb 12, 2025

History

35 Commits
Feb 12, 2025
May 13, 2022
Oct 12, 2016
Aug 25, 2023
Oct 17, 2016
Aug 24, 2023
Aug 25, 2023
Dec 5, 2016

Repository files navigation

State machine

The state machine is a flexible library that helps you move Eloquent models from States through Transitions while emitting events along the way.

Example

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.

Installation

composer require hyn/state-machine

Read more about installation and configuration on state-machine.readme.io.

Tests

Run the tests with:

vendor/bin/phpunit

About

The hyn state machine package is a flexible library that helps you move Eloquent models from States through Transitions while emitting events along the way.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages