You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|**Traditional**| Self-contained states, IDE navigation | State classes or model |
89
+
|**Hybrid Enum**| Centralized workflow visualization | Single enum file |
90
+
91
+
Both approaches are demonstrated in the [laravel-stateflow-demo](https://github.com/HPWebdeveloper/laravel-stateflow-demo): **Orders** (traditional) and **Bookings** (enum).
92
+
84
93
Laravel StateFlow solves this with **centralized workflow definition** — see your entire state machine at a glance:
85
94
86
95
```php
@@ -221,15 +230,6 @@ php artisan migrate
221
230
222
231
## Preparation in 4 simple Steps
223
232
224
-
StateFlow supports **two approaches** for defining your state machine:
|**Traditional**| Self-contained states, IDE navigation | State classes or model |
229
-
|**Hybrid Enum**| Centralized workflow visualization | Single enum file |
230
-
231
-
Both approaches are demonstrated in the [laravel-stateflow-demo](https://github.com/HPWebdeveloper/laravel-stateflow-demo): **Orders** (traditional) and **Bookings** (enum).
232
-
233
233
### 1. Add State Column to Your Model
234
234
235
235
Add a `state` column to the model that will have state transitions. For example, if you have an `Order` model:
0 commit comments