spatie/laravel-model-states
State support for models observed · 2026-08-28
Health v2 · maintenance only
91/100
- Activity 93
- Release rhythm 82
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-02. Adoption (stars, forks) is never an input.
- gap_med: 33.0
- age_days: 2556
- days_rel: 42
- days_push: 42
- n_releases_24m: 17
Adoption not part of the score
1302 stars · 105 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
A Laravel package that adds state machine support to Eloquent models, letting each state be a separate class with defined transitions. It handles state serialization to the database and provides controlled state transition logic.
Use cases
- implement a state machine for laravel eloquent models
- model order or payment statuses in laravel
- manage allowed state transitions on database records
- replace status string columns with typed state classes
- add state pattern behaviour to php models
When to choose
- you use Laravel/Eloquent and need typed, class-based model states
- you want enforced, validated transitions between states
- you need per-state behaviour and serialization handled automatically
When to avoid
- you're not using Laravel or Eloquent
- a simple enum or string status column is sufficient
- you need a full standalone workflow engine rather than model states
Facets
library · maturity stable
state-management orm serialization web-development backend developer-tools php laravel eloquent state-machine state-pattern spatie
10 sources
- readme: https://github.com/spatie/laravel-model-states · fetched 2026-08-28 · c53487449f61
- homepage: https://spatie.be/docs/laravel-model-states · fetched 2026-08-29 · 244bc3f7ec92
- site_page: https://spatie.be/docs · fetched 2026-08-29 · 08e024d86d95
- site_page: https://spatie.be/about-us · fetched 2026-08-29 · d3cb88e4b34c
- site_page: https://spatie.be/docs/laravel-model-states/v2 · fetched 2026-08-29 · 3eb97a4ac973
- site_page: https://spatie.be/docs/laravel-model-states/v1 · fetched 2026-08-29 · 6d83c2faa03e
- site_page: https://spatie.be/docs/laravel-model-states/v2/02-postcardware · fetched 2026-08-29 · 2e197de88c8f
- site_page: https://spatie.be/docs/laravel-model-states/v2/03-requirements · fetched 2026-08-29 · 722a05537321
- site_page: https://spatie.be/docs/laravel-model-states/v2/04-installation-setup · fetched 2026-08-29 · 0f3238cd1e4f
- site_page: https://spatie.be/docs/laravel-model-states/v2/05-questions-issues · fetched 2026-08-29 · eab7724aa518
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| spatie/laravel-model-states | main | 91 |
For agents
markdown · JSON · MCP: product_card(name="spatie/laravel-model-states")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem