myclabs/php-enum
myclabs/php-enum brings SplEnum-style enums to PHP. Define enum classes, get autogenerated static constructors, validate values, compare instances, list possible values, and use enums as parameter/return types with extra methods—without a PHP extension.
|
Package
|
Score
|
Description
|
Stars
|
Likes
|
Forks
|
Downloads
|
Issues
|
Score
|
Opportunity
|
License
|
Last Release
|
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| bensampo/laravel-enum | 0.85 | Laravel Enum provides a powerful enum implementation for Laravel with class-constant definitions, instantiation, casting, validation, localization, bitwise/flag enums, and an artisan generator. Not recommended for new projects—use native PHP 8.1 enums. | 2,029 | 2,044 | 159 | 311K | 1 | 15.0 | 30.2 | MIT | — | |
| marc-mabe/php-enum | 0.85 | Native PHP enum implementation via an abstract base class. Extend it to define enumerations from public constants (supports scalars, null, and arrays), create and compare enum instances, and keep a strict set of named values for safer domain modeling. | 497 | 503 | 36 | 4M | 1 | 18.3 | 57.2 | BSD-3-Clause | 8 months ago | |
| paillechat/php-enum | 0.82 | PHP 7+ enum library: define enums by extending Enum and declaring constants, then instantiate via static named calls (IssueType::ONE()). Instances are strict-equal singletons, work with in_array/type hints, and can convert to/from names. | 16 | 17 | 3 | 468 | 0 | 2.0 | 20.2 | MIT | 7 years ago | |
| henzeb/enumhancer | 0.80 | — | 69 | 70 | 8 | 27K | 0 | 21.5 | 39.4 | AGPL-3.0 | 5 months ago | |
| spatie/enum | 0.79 | Obsolete: PHP 8.1+ has native enums (recommended). Spatie Enum provides strongly typed, object-based enums for older PHP versions, enabling IDE-friendly static analysis and refactoring. Define enums via @method annotations and call StatusEnum::draft(). | 847 | 850 | 67 | 1M | 0 | 15.2 | 43.1 | MIT | 4 years ago |
How can I help you explore Laravel packages today?