spatie/laravel-model-states
State support for Eloquent models
2.14.2
7.9M downloads/mo
#1100 most downloaded on Packagist
spatie/laravel-model-states
What this package is like to depend on
Last release 1 months ago
22 Jul 2026
Ships fairly regularly
a new release about every 2 months
Nearly every release is documented
notes for 59 of 63 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
63 releases · first in 2019
6 releases in the last 12 months
see the full history below
Release timeline
62 releases · Sep 2019 to Jul 2026Releases
latest 60 of 63-
2.14.222 Jul 2026Release notes
Open source →What's Changed
- Bump actions/checkout from 6 to 7 by @dependabot[bot] in #309
- feat: implement Stringable interface on abstract State class by @maartenpaauw in #310
Full Changelog: 2.14.1...2.14.2
Release notes
Open source →What's Changed
- Bump actions/checkout from 6 to 7 by @dependabot[bot] in https://github.com/spatie/laravel-model-states/pull/309
- feat: implement Stringable interface on abstract State class by @maartenpaauw in https://github.com/spatie/laravel-model-states/pull/310
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.14.1...2.14.2
-
2.14.122 Apr 2026Release notes
Open source →What's Changed
- Bump dependabot/fetch-metadata from 1 to 3 by @dependabot[bot] in #305
- Fix PHP 8.5 regression writing raw state FQN for aliased defaults by @freekmurze in #308
Full Changelog: 2.14.0...2.14.1
Release notes
Open source →What's Changed
- Bump dependabot/fetch-metadata from 1 to 3 by @dependabot[bot] in https://github.com/spatie/laravel-model-states/pull/305
- Fix PHP 8.5 regression writing raw state FQN for aliased defaults by @freekmurze in https://github.com/spatie/laravel-model-states/pull/308
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.14.0...2.14.1
-
2.14.020 Apr 2026Release notes
Open source →What's Changed
- Fix PHP 8.5 trait binding order bug when state is cast via casts() method by @conorjmurphy in #306
Full Changelog: 2.13.1...2.14.0
Release notes
Open source →What's Changed
- Fix PHP 8.5 trait binding order bug when state is cast via casts() method by @conorjmurphy in https://github.com/spatie/laravel-model-states/pull/306
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.13.1...2.14.0
-
2.13.122 Feb 2026Release notes
Open source →What's Changed
- Use spatie/php-attribute-reader by @freekmurze in #303
Full Changelog: 2.13.0...2.13.1
Release notes
Open source →What's Changed
- Use spatie/php-attribute-reader by @freekmurze in https://github.com/spatie/laravel-model-states/pull/303
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.13.0...2.13.1
-
2.13.021 Feb 2026 -
2.12.210 Dec 2025Release notes
Open source →What's Changed
- Update issue template by @AlexVanderbist in #292
- Improve punctuation for clarity in transition handling by @runofthemill in #296
- Bump stefanzweifel/git-auto-commit-action from 6 to 7 by @dependabot[bot] in #294
- Update transition delimiter from '-' to '->' in StateConfig by @lukas-staab in #300
- Bump actions/checkout from 4 to 6 by @dependabot[bot] in #298
New Contributors
- @AlexVanderbist made their first contribution in #292
- @runofthemill made their first contribution in #296
- @lukas-staab made their first contribution in #300
Full Changelog: 2.12.1...2.12.2
Release notes
Open source →What's Changed
- Update issue template by @AlexVanderbist in https://github.com/spatie/laravel-model-states/pull/292
- Improve punctuation for clarity in transition handling by @runofthemill in https://github.com/spatie/laravel-model-states/pull/296
- Bump stefanzweifel/git-auto-commit-action from 6 to 7 by @dependabot[bot] in https://github.com/spatie/laravel-model-states/pull/294
- Update transition delimiter from '-' to '->' in StateConfig by @lukas-staab in https://github.com/spatie/laravel-model-states/pull/300
- Bump actions/checkout from 4 to 6 by @dependabot[bot] in https://github.com/spatie/laravel-model-states/pull/298
New Contributors
- @AlexVanderbist made their first contribution in https://github.com/spatie/laravel-model-states/pull/292
- @runofthemill made their first contribution in https://github.com/spatie/laravel-model-states/pull/296
- @lukas-staab made their first contribution in https://github.com/spatie/laravel-model-states/pull/300
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.12.1...2.12.2
-
2.12.101 Aug 2025Release notes
Open source →What's Changed
- feat: add count and boolean methods for available transactions by @WatheqAlshowaiter in #290
New Contributors
- @WatheqAlshowaiter made their first contribution in #290
Full Changelog: 2.12.0...2.12.1
Release notes
Open source →What's Changed
- feat: add count and boolean methods for available transactions by @WatheqAlshowaiter in https://github.com/spatie/laravel-model-states/pull/290
New Contributors
- @WatheqAlshowaiter made their first contribution in https://github.com/spatie/laravel-model-states/pull/290
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.12.0...2.12.1
-
2.12.028 Jul 2025Release notes
Open source →What's Changed
- Add the field property to StateChanged event by @aabadawy in #286
- Bump stefanzweifel/git-auto-commit-action from 5 to 6 by @dependabot[bot] in #283
- Add
transitionableStateInstances()method to get state objects for all transitionable states by @A909M in #285 - feat: support custom transition constructors extending DefaultTransit… by @zayedadel in #284
Full Changelog: 2.11.3...2.12.0
Release notes
Open source →What's Changed
- Add the field property to StateChanged event by @aabadawy in https://github.com/spatie/laravel-model-states/pull/286
- Bump stefanzweifel/git-auto-commit-action from 5 to 6 by @dependabot[bot] in https://github.com/spatie/laravel-model-states/pull/283
- Add
transitionableStateInstances()method to get state objects for all transitionable states by @A909M in https://github.com/spatie/laravel-model-states/pull/285 - feat: support custom transition constructors extending DefaultTransit… by @zayedadel in https://github.com/spatie/laravel-model-states/pull/284
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.11.3...2.12.0
-
2.11.323 May 2025Release notes
Open source →What's Changed
- Add support for registering states from multiple custom directories. by @A909M in https://github.com/spatie/laravel-model-states/pull/282
New Contributors
- @A909M made their first contribution in https://github.com/spatie/laravel-model-states/pull/282
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.11.2...2.11.3
-
2.11.221 Mar 2025Release notes
Open source →What's Changed
- use laravel [validationRule] interface instead of [Rule] deprecated interface by @aabadawy in https://github.com/spatie/laravel-model-states/pull/276
New Contributors
- @aabadawy made their first contribution in https://github.com/spatie/laravel-model-states/pull/276
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.11.1...2.11.2
-
2.11.128 Feb 2025Release notes
Open source →What's Changed
- fix(config): var annotation for
$baseStateClassand$defaultStateClassby @maartenpaauw in https://github.com/spatie/laravel-model-states/pull/275
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.11.0...2.11.1
- fix(config): var annotation for
-
2.11.026 Feb 2025Release notes
Open source →What's Changed
- Contract / Interface for Models that use
HasStatestrait. by @aSeriousDeveloper in https://github.com/spatie/laravel-model-states/pull/274
New Contributors
- @aSeriousDeveloper made their first contribution in https://github.com/spatie/laravel-model-states/pull/274
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.10.1...2.11.0
- Contract / Interface for Models that use
-
2.10.114 Feb 2025Release notes
Open source →Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.10.0...2.10.1
-
2.10.030 Dec 2024Release notes
Open source →What's Changed
- Added test to ensure same-state transition fails when not allowed by @zayedadel in https://github.com/spatie/laravel-model-states/pull/270
New Contributors
- @zayedadel made their first contribution in https://github.com/spatie/laravel-model-states/pull/270
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.9.0...2.10.0
-
2.9.016 Dec 2024Release notes
Open source →What's Changed
- Feature: Added ...transitionArgs to default transition constructor call to allow arguments use for custom default transition by @IlliaVeremiev in https://github.com/spatie/laravel-model-states/pull/269
New Contributors
- @IlliaVeremiev made their first contribution in https://github.com/spatie/laravel-model-states/pull/269
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.8.0...2.9.0
-
2.8.011 Dec 2024Release notes
Open source →What's Changed
- Make using allowAllTransitions() less cumbersome by @jonjakoblich in https://github.com/spatie/laravel-model-states/pull/265
New Contributors
- @jonjakoblich made their first contribution in https://github.com/spatie/laravel-model-states/pull/265
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.7.2...2.8.0
-
2.7.227 Sep 2024Release notes
Open source →What's Changed
- [docs] Fix documentation badges by @maartenpaauw in https://github.com/spatie/laravel-model-states/pull/254
- [docs] Add generic docblock to code snippet by @maartenpaauw in https://github.com/spatie/laravel-model-states/pull/253
- Fix missing namespace in phpdoc by @conorjmurphy in https://github.com/spatie/laravel-model-states/pull/255
- Update 01-introduction.md by @StreetYo in https://github.com/spatie/laravel-model-states/pull/257
- docs: update 03-listing-states.md improve use statements by @mmachatschek in https://github.com/spatie/laravel-model-states/pull/261
- fix(config): var annotation for
$allowedTransitionsby @maartenpaauw in https://github.com/spatie/laravel-model-states/pull/259
New Contributors
- @maartenpaauw made their first contribution in https://github.com/spatie/laravel-model-states/pull/254
- @conorjmurphy made their first contribution in https://github.com/spatie/laravel-model-states/pull/255
- @StreetYo made their first contribution in https://github.com/spatie/laravel-model-states/pull/257
- @mmachatschek made their first contribution in https://github.com/spatie/laravel-model-states/pull/261
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.7.1...2.7.2
-
2.7.107 Mar 2024Release notes
Open source →What's Changed
- Use jsonSerialize in StateCaster by @piotrjoniec in https://github.com/spatie/laravel-model-states/pull/252
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.7.0...2.7.1
-
2.7.001 Mar 2024Release notes
Open source →What's Changed
- Implement SerializesCastableAttributes in StateCaster by @piotrjoniec in https://github.com/spatie/laravel-model-states/pull/251
New Contributors
- @piotrjoniec made their first contribution in https://github.com/spatie/laravel-model-states/pull/251
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.6.2...2.7.0
-
2.6.215 Feb 2024Release notes
Open source →What's Changed
- Add support for laravel 11 by @shuvroroy in https://github.com/spatie/laravel-model-states/pull/249
New Contributors
- @shuvroroy made their first contribution in https://github.com/spatie/laravel-model-states/pull/249
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.6.1...2.6.2
-
2.6.107 Feb 2024Release notes
Open source →What's Changed
- Typo in 01-configuring-states.md by @MarceauKa in https://github.com/spatie/laravel-model-states/pull/241
- Bump stefanzweifel/git-auto-commit-action from 4 to 5 by @dependabot in https://github.com/spatie/laravel-model-states/pull/240
- Bump actions/cache from 3 to 4 by @dependabot in https://github.com/spatie/laravel-model-states/pull/245
- Generics PHPDoc annotations for State class by @lorenzolosa in https://github.com/spatie/laravel-model-states/pull/247
New Contributors
- @MarceauKa made their first contribution in https://github.com/spatie/laravel-model-states/pull/241
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.6.0...2.6.1
-
2.6.027 Sep 2023Release notes
Open source →What's Changed
- Feature/Method to allow all state transitions by @fmeccanici in https://github.com/spatie/laravel-model-states/pull/238
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.5.0...2.6.0
-
2.5.025 Sep 2023Release notes
Open source →What's Changed
- Bump actions/checkout from 3 to 4 by @dependabot in https://github.com/spatie/laravel-model-states/pull/236
- Feature/Allow to set custom StateChanged event by @fmeccanici in https://github.com/spatie/laravel-model-states/pull/237
New Contributors
- @fmeccanici made their first contribution in https://github.com/spatie/laravel-model-states/pull/237
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.4.6...2.5.0
-
2.4.617 Apr 2023Release notes
Open source →What's Changed
- Don't assume scandir() always returns current and parent directory first by @sebastiandedeyne in https://github.com/spatie/laravel-model-states/pull/228
New Contributors
- @sebastiandedeyne made their first contribution in https://github.com/spatie/laravel-model-states/pull/228
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.4.5...2.4.6
-
2.4.520 Feb 2023Release notes
Open source →What's Changed
- Refactor tests to pest by @AyoobMH in https://github.com/spatie/laravel-model-states/pull/217
New Contributors
- @AyoobMH made their first contribution in https://github.com/spatie/laravel-model-states/pull/217
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.4.4...2.4.5
-
2.4.424 Jan 2023Release notes
Open source →What's Changed
- Add missing
RegisterStateAttribute by @ralphjsmit in https://github.com/spatie/laravel-model-states/pull/224
New Contributors
- @ralphjsmit made their first contribution in https://github.com/spatie/laravel-model-states/pull/224
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.4.3...2.4.4
- Add missing
-
2.4.323 Jan 2023Release notes
Open source →What's Changed
- Recommend not to use hypens in the name by @barclaymichael in https://github.com/spatie/laravel-model-states/pull/210
- Add Dependabot Automation by @patinthehat in https://github.com/spatie/laravel-model-states/pull/218
- Bump actions/checkout from 2 to 3 by @dependabot in https://github.com/spatie/laravel-model-states/pull/219
- Bump actions/cache from 2 to 3 by @dependabot in https://github.com/spatie/laravel-model-states/pull/220
- Add PHP 8.2 Support by @patinthehat in https://github.com/spatie/laravel-model-states/pull/221
- Update deps for laravel 10 by @hailam in https://github.com/spatie/laravel-model-states/pull/223
New Contributors
- @barclaymichael made their first contribution in https://github.com/spatie/laravel-model-states/pull/210
- @dependabot made their first contribution in https://github.com/spatie/laravel-model-states/pull/219
- @hailam made their first contribution in https://github.com/spatie/laravel-model-states/pull/223
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.4.2...2.4.3
-
2.4.201 Aug 2022Release notes
Open source →What's Changed
- Removed Model type enforcement and replaced with PHPDoc by @luckcolors in https://github.com/spatie/laravel-model-states/pull/208
New Contributors
- @luckcolors made their first contribution in https://github.com/spatie/laravel-model-states/pull/208
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.4.1...2.4.2
-
2.4.129 Jul 2022Release notes
Open source →What's Changed
- Update .gitattributes by @angeljqv in https://github.com/spatie/laravel-model-states/pull/205
- Ensures field is always set when changing states by @ChangingTerry in https://github.com/spatie/laravel-model-states/pull/207
New Contributors
- @angeljqv made their first contribution in https://github.com/spatie/laravel-model-states/pull/205
- @ChangingTerry made their first contribution in https://github.com/spatie/laravel-model-states/pull/207
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.4.0...2.4.1
-
2.4.007 Jun 2022Release notes
Open source →What's Changed
- Manually register concrete state classes by @javoscript in https://github.com/spatie/laravel-model-states/pull/203
New Contributors
- @javoscript made their first contribution in https://github.com/spatie/laravel-model-states/pull/203
Full Changelog: https://github.com/spatie/laravel-model-states/compare/2.3.0...2.4.0
-
2.3.021 Apr 2022Nothing published for this version
-
2.2.003 Mar 2022 -
2.1.419 Jan 2022Nothing published for this version
-
2.1.306 Dec 2021Nothing published for this version
-
2.1.208 Oct 2021 -
2.1.101 Sep 2021Release notes
Open source →- Support for custom transition classes'
canTransitioninState::canTransitionTo(#185)
- Support for custom transition classes'
-
2.1.021 Apr 2021 -
2.0.209 Dec 2020 -
2.0.109 Dec 2020 -
2.0.004 Dec 2020Release notes
Open source →The biggest change in v2 is that states now know which fields they belong to. So instead of having to pass in fields like so:
$model->canTransitionTo(StateB::class, 'status');You can now do:
$model->status->canTransitionTo(StateB::class);This change means that a lot of boilerplate code can be removed. Also keep in mind that this package wants you to always use state objects, and never their serialized values. That's why many other methods have been removed, in favour of Laravel's built-in model casts.
- States aren't configured on models anymore, but on the state class itself. Refer to the docs for more info.
HasStates::transitionableStates(string $fromClass, string $field)has been removed.State::transitionableStates()now doesn't need the$fieldparameter anymore.HasStates::getStates()now returns the morph values instead of the hardcoded class names.- Default states are only set on model creations.
State::find()has been removed.State::isOneOf()is removed,State::equalsnow accepts multiple state objects or morph classes.State::is()is removed, you should useState::equals().- Dropped support for Laravel 5, 6, and 7. The minimal required version is
laravel/framework:^8 - Dropped support for PHP 7.2 and 7.3. The minimal required version is
php:^7.4 - Proper support for
finalStateinStateChangedevent
-
1.9.101 Dec 2020 -
1.9.025 Aug 2020 -
1.8.019 Aug 2020 -
1.7.019 Aug 2020 -
1.6.323 Jun 2020 -
1.6.216 Jun 2020 -
1.6.127 Mar 2020Release notes
Open source →- change
static::call toself::for privateState::resolveStateMappingmethod (#75)
- change
-
1.6.003 Mar 2020 -
1.5.118 Feb 2020 -
1.5.013 Dec 2019Release notes
Open source →- ❗️
$finalStatein theStateChangedevent is deprecated and will always be null. This is because of a fix for bug #49. This fix might have unforeseen effects if you're usingStateChanged.
- ❗️
-
1.4.228 Nov 2019 -
1.4.130 Oct 2019 -
1.4.029 Oct 2019 -
1.3.128 Oct 2019 -
1.3.028 Oct 2019 -
1.2.021 Oct 2019 -
1.1.311 Oct 2019 -
1.1.203 Oct 2019 -
1.1.102 Oct 2019 -
1.1.002 Oct 2019