spatie/enum
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().
|
Package
|
Score
|
Description
|
Stars
|
Likes
|
Forks
|
Downloads
|
Issues
|
Score
|
Opportunity
|
License
|
Last Release
|
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 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. | 20 | 20 | 2 | 50K | 0 | 0.2 | 46.7 | MIT | — | |
| spatie/laravel-enum | 0.85 | 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. | 364 | 365 | 36 | 110K | 1 | 31.4 | 40.3 | MIT | 1 year ago | |
| daverandom/enum | 0.85 | daverandom/enum adds a lightweight enum implementation for PHP, providing type-safe sets of named values with strict validation and easy comparison. Useful for replacing magic numbers/strings in domain models, configs, and APIs. | 0 | — | 0 | — | 0 | 20.0 | — | MIT | 8 years ago | |
| marc-mabe/php-enum | 0.84 | 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. | 494 | 500 | 36 | 4M | 1 | 32.7 | 63.0 | BSD-3-Clause | 6 months ago | |
| dasprid/enum | 0.84 | dasprid/enum brings type-safe, object-based enums to PHP. Define a fixed set of values with labels, comparisons, serialization and validation, reducing magic strings/ints and improving readability in domain models and configuration. | 379 | 382 | 13 | 6M | 0 | 2.3 | 55.3 | BSD-2-Clause | — | |
| archtechx/enums | 0.83 | 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. | 562 | 561 | 23 | 530K | 2 | 27.0 | 48.8 | MIT | 10 months ago | |
| bensampo/laravel-enum | 0.82 | 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,035 | 2,051 | 160 | 309K | 1 | 15.1 | 30.1 | MIT | — | |
| myclabs/php-enum | 0.79 | 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,729 | 2,764 | 128 | 3M | 12 | 50.2 | 54.3 | MIT | 1 year ago | |
| doctrine/annotations | 0.73 | Doctrine Annotations parses and reads docblock annotations for PHP projects. Considered feature complete since PHP 8 attributes are the native replacement; this package now focuses on bugfixes and security fixes. Documentation available on doctrine-project.org. | 6,745 | 6,785 | 230 | 6M | 26 | 68.6 | 58.7 | MIT | 1 year ago | |
| pear/xml_util | 0.73 | PEAR XML_Util provides handy helpers for working with XML: build attribute lists from arrays, generate tags, validate XML names, and more. Lightweight utility methods for creating and checking XML document parts in PHP. | 2 | 2 | 3 | 36K | 0 | 11.4 | 65.0 | — | 5 years ago | |
| pear/pear | 0.72 | PEAR (PHP Extension and Application Repository) provides a classic package manager and installer for PHP, enabling you to discover, install, and update reusable libraries and extensions. Includes tooling for packaging, channels, dependency resolution, and versioned releases. | 114 | 115 | 105 | 19K | 1 | 29.0 | 36.2 | NOASSERTION | 2 months ago | |
| spatie/data-transfer-object | 0.68 | PHP 8+ data transfer objects with “batteries included”: map and cast input arrays into typed DTOs, validate via attributes, and handle nested objects/collections. Note: package is deprecated; consider spatie/laravel-data or cuyz/valinor. | 2,233 | 2,192 | 190 | 543K | 0 | 22.9 | 38.8 | MIT | 3 years ago | |
| sebastian/version | 0.68 | Library for deriving a PHP project’s version from Git. Provide a release string and project path; Version::asString() returns the release, a -dev suffix, or git describe output (tags/commits) depending on repo state and release format. | 6,583 | 6,602 | 36 | 13M | 0 | 47.4 | 53.4 | BSD-3-Clause | 2 months ago | |
| zendframework/zend-coding-standard | 0.68 | Zend Framework Coding Standard ruleset for PHP_CodeSniffer to enforce ZF repository style, with composer scripts for checking (phpcs) and auto-fixing (phpcbf). Note: repository abandoned; moved to laminas/laminas-coding-standard. | 35 | 42 | 7 | 2K | 7 | 11.9 | 31.0 | BSD-3-Clause | 6 years ago |
How can I help you explore Laravel packages today?