🎉 Laravel-Statecraft v1.0 is out! #31
Pinned
Grazulex
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
🎉 Laravel-Statecraft v1.0 is out!
After weeks of design, refinement, and testing, I’m proud to announce the official release of Laravel-Statecraft v1.0 🧩 — a powerful, elegant, and testable state machine engine for Laravel applications.
🧠 What is Laravel-Statecraft?
Laravel-Statecraft helps you model complex workflows and transitions in your Eloquent models, using declarative YAML definitions or PHP classes.
It gives you full control over guards, actions, events, and even transition history — all with clean syntax and full testability.
✨ Key Features
✅ Declarative Workflows — Define transitions in YAML
🛡️ Guard Logic — Support for complex AND / OR / NOT expressions
⚙️ Actions — Trigger lifecycle actions on transition
🔄 Auto Methods — Use
$model->canApprove()
or$model->approve()
🧪 Built-in Testing — Easily assert transitions with
StateMachineTester
🔔 Event System — Listen for
Transitioning
andTransitioned
events📜 Optional History Tracking — Record every state change
🧩 Dynamic Resolution — Guards and actions resolved via the Laravel container
📊 Export Formats — JSON, Mermaid, and Markdown
🛠 Powerful CLI Tools — Artisan commands to create, validate, export and inspect workflows
🧰 Customizable — Configurable paths, events, naming conventions, etc.
🧾 Example YAML Workflow
🧩 Guard Expressions
Statecraft allows logical guard expressions (AND / OR / NOT) for business rules like:
🧪 Testing Made Easy
🔧 Artisan Commands
Generate and manage everything via CLI:
📚 Learn More
Check out the full documentation to explore:
💡 Get Started
Install the package:
Optionally publish config and migrations:
❤️ About
Laravel-Statecraft is part of the Grazulex Tools ecosystem:
→ Laravel-Arc (DTOs)
→ Laravel-Flowpipe (Composable Pipelines)
→ Laravel-Statecraft (State Machines)
Crafted for clean, modular, and testable Laravel applications.
🧙 Author: Jean‑Marc Strauven / @Grazulex
✍️ Blog: Open Source My Friend
Let me know what you build with Laravel-Statecraft — and feel free to share feedback, ideas, or feature requests below! 🗨️
Beta Was this translation helpful? Give feedback.
All reactions