fer-projekt/laravel-state-machine

Helpes your control your state using enums.

dev-main 2024-04-25 06:58 UTC

This package is auto-updated.

Last update: 2024-04-25 06:58:57 UTC


README

This package simplify controlling the transition between model states, allowing you to prevent unlogically transition and also controlling the initial state of the model using the PHP enums.

Each enum allows you to define your states, the allowed transitions and the initial state, all in one place.

Installation

You can install the package via composer:

composer require fer-projekt/laravel-state-machine

Usage

Development

Clone the package from the github:

git clone https://github.com/fer-projekt/laravel-state-machine.git

cd laravel-state-machine

Starting & stopping docker

docker-compose up -d
docker-compose down

Install dependencies via composer and testing:

docker-compose exec app bash
composer update
phpunit

License

The MIT License (MIT). Please see License File for more information.