paillechat/php-enum
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.
|
Package
|
Score
|
Description
|
Stars
|
Likes
|
Forks
|
Downloads
|
Issues
|
Score
|
Opportunity
|
License
|
Last Release
|
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| laudis/typed-enum | 0.89 | — | 4 | 4 | 0 | 32K | 0 | 0.0 | 52.5 | MIT | — | |
| adrenalinkin/enum-mapper | 0.89 | — | 1 | 1 | 0 | 0 | 0 | 0.0 | — | MIT | — | |
| elao/enum | 0.89 | Opinionated extensions for PHP 8.1+ native enums with readable labels, flag/bitmask enums, and extra values. Includes integrations for Symfony (Forms, HTTP Kernel arg resolver, Translation, VarDumper), Doctrine ORM/ODM, and Faker. | 327 | 327 | 29 | 33K | 15 | 30.5 | 36.7 | MIT | 3 months ago | |
| spatie/laravel-enum | 0.88 | Laravel integration for spatie/enum: use Enum base class in Laravel, cast model attributes to enums (including nullable and arrays), and get Laravel-friendly behavior via custom casts and Castable support for Eloquent. | 366 | 369 | 36 | 147K | 0 | 11.3 | 36.0 | MIT | 1 year ago | |
| henzeb/enumhancer | 0.88 | — | 69 | 70 | 8 | 20K | 0 | 18.4 | 36.6 | AGPL-3.0 | 7 months ago | |
| henzeb/enumhancer-ide-helper | 0.88 | Laravel IDE helper for enhanced PHP enums. Improves autocompletion and type hints for Enumhancer features in PhpStorm and similar IDEs, generating stubs/metadata so enum methods, cases, and helpers are easier to discover and use. | 0 | 0 | 0 | 1K | 0 | 0.3 | 42.9 | AGPL-3.0 | 3 years ago | |
| open-southeners/laravel-model-status | 0.88 | Lightweight Laravel model status handling using native PHP enums—no extra tables needed. Define a status enum, attach it via a PHP attribute, and use a trait for helpers like setStatus, setStatusWhen, hasStatus, and optional status events. | 0 | 0 | 0 | 60 | 0 | 18.6 | 27.9 | MIT | 3 months ago | |
| timeweb/phpstan-enum | 0.87 | PHPStan extension for PHP enums. Provides additional rules and type inference to catch invalid enum values and comparisons, improve static analysis around backed/unit enums, and surface enum-related bugs early in CI. | 44 | 44 | 7 | 50K | 1 | 5.1 | 42.1 | MIT | 1 year ago | |
| prinsfrank/enums | 0.87 | — | 2 | 2 | 1 | 53K | 0 | 1.8 | 55.3 | MIT | 1 year ago | |
| norotaro/enumata | 0.86 | — | 3 | 4 | 1 | 257 | 1 | 2.9 | 25.0 | MIT | 1 year ago | |
| konekt/enum | 0.86 | Lightweight PHP enum base class (pre-PHP 8.1) for defining value-safe constants via abstract Enum subclasses. Simple instantiation, validation and utilities, with docs and optional Laravel Eloquent integration via konekt/enum-eloquent. | 21 | 21 | 2 | 74K | 0 | 0.2 | 48.7 | MIT | — | |
| aboutcoders/enum-serializer-bundle | 0.86 | Symfony bundle adding JMS Serializer support for myclabs/php-enum enums. Register enum types via config or tagged services, then serialize/deserialize to JSON using enum class names in @Type annotations or directly in serializer calls. | 3 | 4 | 5 | 594 | 1 | 0.6 | 30.0 | MIT | 5 years ago | |
| konekt/enum-eloquent | 0.86 | Laravel Eloquent casting for Konekt Enums. Add the CastsEnums trait and define a $enums map on your model to automatically convert attributes to Enum objects, supporting Konekt Enum 2–4 and Laravel 8–12. | 63 | 64 | 9 | 66K | 2 | 1.0 | 41.6 | MIT | — | |
| art-fatal/doctrine-enum-bundle | 0.86 | — | 0 | 0 | — | 0 | — | 0.0 | — | — | — | |
| 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. | 498 | 505 | 35 | 5M | 1 | 15.3 | 56.5 | BSD-3-Clause | 10 months ago | |
| archtechx/enums | 0.85 | Modern PHP enum helpers: casting, validation, labels, and convenience methods for native enums. Add common patterns like options arrays, random values, and comparisons to make enums easier to use across Laravel apps and APIs. | 566 | 568 | 23 | 597K | 2 | 7.0 | 42.0 | MIT | 1 year ago | |
| spatie/enum | 0.84 | 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(). | 851 | 853 | 67 | 1M | 0 | 15.4 | 43.7 | MIT | 4 years ago | |
| bensampo/laravel-enum | 0.84 | 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,031 | 2,046 | 157 | 338K | 1 | 15.0 | 30.2 | MIT | — | |
| daverandom/enum | 0.82 | Lightweight PHP enum base class: extend a single abstract class and define members as constants. Includes static helpers to validate and resolve enum names and values. Useful for simple, shared enum functionality. | 0 | 0 | 0 | 23 | 0 | 0.3 | 6.6 | MIT | 8 years ago | |
| myclabs/php-enum | 0.82 | 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. | 2,726 | 2,760 | 128 | 3M | 12 | 30.2 | 45.6 | MIT | 1 year ago |
How can I help you explore Laravel packages today?