NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #1122 most downloaded on Packagist
Simple, extensible and powerful enumeration implementation for Laravel.
Last release 1 months ago
03 Sep 2026
Ships fairly regularly
a new release about every 3 months
Most releases are documented
notes for 50 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
105 releases · first in 2017
Keep converting match/switch over an enum to the native enum instead of appending ->value to every arm
match/switch over an enum to the native enum instead of appending ->value to every arm->value instead of converting match/switch over a nullable or union-typed enum, where comparing native enum instances would not preserve the original value comparisonSupport Laravel 13
One column per quarter.
Convert asArray() to native enum automatically
Convert asArray() to native enum automatically (#336)
Simplify implementation of Enum::fromKey to native enum with dynami…
Simplify implementation of Enum::fromKey to native enum with dynami…
Enum::fromKey to native enum with dynamic class const fetchHandle NeverType when converting to native enums
Handle NeverType when converting to native enums (#356)
Support Laravel 12 and Rector 2
Support Laravel 12 and Rector 2
Fix conversion of in() and notIn() to native enums when called wi…
Fix conversion of in() and notIn() to native enums when called wi…
in() and notIn() to native enums when called with non-arrays### Added - Support Laravel 11
Allow installation alongside PHPUnit 11
Allow installation alongside PHPUnit 11 (#352)
Check if value is int or string in conversion of `Enum::hasValu…
int or string in conversion of `Enum::hasValu…int or string in conversion of Enum::hasValue() to native enumAdd conversion of Enum::hasValue() to native enum
Add conversion of Enum::hasValue() to native enum
Make php artisan enum:to-native compatible with rector 0.19
php artisan enum:to-native compatible with rector 0.19Add PHPStan rule to detect duplicate enum values
Fix conversion of Enum::fromKey() to native enum
Enum::fromKey() to native enumRemove leading backslash in class names passed to php artisan enum:to-native
php artisan enum:to-nativeConvert single classes in one step with php artisan enum:to-native
php artisan enum:to-nativeDisable timeout of rector calls in php artisan enum:to-native
php artisan enum:to-nativeUse command enum:to-native for simplified one-step conversion of classes that extend BenSampo\Enum\Enum to native PHP enums
enum:to-native for simplified one-step conversion of classes that extend BenSampo\Enum\Enum to native PHP enumsDeprecate command enum:to-native in favor of Rector conversion
BenSampo\Enum\Enum to native PHP enumsenum:to-native in favor of Rector conversionEnsure validation rules are always added https://github.com/BenSampo/laravel-enum/pull/327
Add command enum:to-native to convert a class that extends BenSampo\Enum\Enum to a native PHP enum
enum:to-native to convert a class that extends BenSampo\Enum\Enum to a native PHP enumAllow mixed in Enum::hasValue()
mixed in Enum::hasValue()Preserve whitespace in PHPDocs when running enum:annotate command
enum:annotate commandMark Enum::$key and Enum::$description as non-nullable in Enum and document they are unset in FlaggedEnum
Enum::$key and Enum::$description as non-nullable in Enum and document they are unset in FlaggedEnum### Added - Support Laravel 10 298
Fix backtrack regexp error and add Windows EOL support to the annotate command 296
Fix running php artisan enum:annotate on long enum class 294
php artisan enum:annotate on long enum class 294Open EnumServiceProvider for customization 292
EnumServiceProvider for customization 292Eliminate unnecessary abstract class AbstractAnnotationCommand 283
Allow Description attribute usage on class 270
TValue to Enum classEnum::getDescription() with invalid valuesInvalidEnumMemberException constructorEnum::getInstance() in favor or Enum::fromValue()### Fixed - Narrow property type hints 258
Return value for invalid enum case when using the Description attribute 264
Description attribute 264Enum::$key and Enum::$description as stringFlaggedEnum::$value as intPublish language definitions to lang directory 254
Ability to define enum case descriptions using Description attribute.
Description attribute.The annotate command now uses composer to parse directories for instances of enums instead of hanneskod/classtools
annotate command now uses composer to parse directories for instances of enums instead of hanneskod/classtoolsCastsEnums trait. Laravel attribute casting should be used now instead. 247Suppress deprecated notice on PHP8.1 236
Allow package to be installed with PHP 8.1 #233
Fixed validation error message localization when using string validation rules #227
Fixed broken enums due to wrapping of long constant names in method annotations #226
### Fixed - Fixed type issued in PHP 7.3
addAllFlags() method to flagged enums
addAllFlags() method to flagged enumsremoveAllFlags() method to flagged enumsUpdate doctrine/dbal requirement from ^2.9 to ^2.9|^3.0 #208
Switched from Travis to GitHub Actions
fix:toSelectArray breaking change + document toArray change #184
Model annotation has been removed in favour of laravel-ide-helper #165
laravel-ide-helper #165Model attributes which use Laravel 7 native casting now return the enum value when serialized. #162 #163
Allow returning null when using native casting #152
null when using native casting #152Deprecate legacy attribute casting in favor of native casting
Deprecate Enum::getInstance() in favor of Enum::fromValue()
EnumValue validation rule allows multiple flags for FlaggedEnums
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →