fer-projekt / laravel-state-machine
Helpes your control your state using enums.
dev-main
2024-04-25 06:58 UTC
Requires
- php: ^8.0
Requires (Dev)
- illuminate/container: ^9.0|^10.0
- illuminate/support: ^9.0|^10.0
- orchestra/testbench: ^7.0|^8.0
This package is auto-updated.
Last update: 2025-04-25 09:13:51 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.