spatie/laravel-enum
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.
|
Package
|
Score
|
Description
|
Stars
|
Likes
|
Forks
|
Downloads
|
Issues
|
Score
|
Opportunity
|
License
|
Last Release
|
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| henzeb/enumhancer-ide-helper | 0.90 | 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 | 2K | 0 | 0.3 | 45.8 | AGPL-3.0 | 3 years ago | |
| acelaya/doctrine-enum-type | 0.89 | Doctrine DBAL type for mapping MyCLabs\Enum\Enum values to entity columns. Provides a reusable PhpEnumType to register enums as custom Doctrine types. Note: largely obsolete now that PHP has native enums and Doctrine supports them. | 131 | 136 | 14 | 14K | 1 | 2.1 | 19.8 | MIT | 5 years ago | |
| 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. | 328 | 326 | 30 | 37K | 15 | 33.2 | 38.6 | MIT | 1 month ago | |
| henzeb/enumhancer | 0.89 | — | 69 | 70 | 8 | 27K | 0 | 21.5 | 39.4 | AGPL-3.0 | 5 months ago | |
| paillechat/php-enum | 0.88 | 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 | 477 | 0 | 2.0 | 20.2 | MIT | 7 years ago | |
| laudis/typed-enum | 0.88 | — | 4 | 4 | 0 | 26K | 0 | 0.0 | 51.1 | MIT | — | |
| daverandom/enum | 0.88 | 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 | 2 | 0 | 0.3 | 6.6 | MIT | 8 years ago | |
| bensampo/laravel-enum | 0.88 | 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 | 318K | 1 | 15.0 | 30.2 | MIT | — | |
| spatie/enum | 0.87 | 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 | |
| art-fatal/doctrine-enum-bundle | 0.87 | — | 0 | 0 | — | 0 | — | 0.0 | — | — | — | |
| archtechx/enums | 0.87 | 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. | 568 | 567 | 23 | 554K | 2 | 7.1 | 41.6 | MIT | 11 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 | 52K | 1 | 5.1 | 42.3 | MIT | 1 year 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 | 65K | 2 | 1.0 | 41.5 | MIT | — | |
| fresh/doctrine-enum-bundle | 0.86 | Symfony bundle adding ENUM type support to Doctrine ORM/DBAL. Register custom enum types and map them to entity fields for safer, consistent values across databases. Works with modern Symfony/Doctrine versions and common platforms like PostgreSQL, MySQL, SQLite, and MSSQL. | 462 | 474 | 75 | 55K | 11 | 29.0 | 35.2 | MIT | 4 months ago | |
| 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 | 545 | 1 | 0.6 | 29.5 | MIT | 5 years 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 | 61K | 0 | 0.0 | 55.3 | MIT | — | |
| norotaro/enumata | 0.85 | — | 3 | 4 | 1 | 185 | 1 | 2.9 | 22.0 | MIT | 1 year ago | |
| adrenalinkin/enum-property-bundle | 0.85 | Symfony bundle integrating EnumMapper: adds Twig filters/functions to convert enum DB values to human labels and back, fetch full enum maps, and provides validation support for enum properties. Install via Composer and enable the bundle in AppKernel. | 0 | 0 | 0 | 0 | 0 | 0.0 | — | MIT | — | |
| larapack/doctrine-support | 0.84 | Laravel package that enhances Doctrine support in Laravel, including support for enum types. Install via Composer and (for Laravel 5.4 and below) register the DoctrineSupportServiceProvider. Use v0.1.3 for Laravel versions older than 5.4. | 175 | 177 | 14 | 9K | 1 | 4.5 | 23.6 | MIT | 6 years ago |
How can I help you explore Laravel packages today?