BenSampo/laravel-enum
Simple, extensible and powerful enumeration implementation for Laravel. observed · 2026-08-28
Health v2 · maintenance only
66/100
- Activity 74
- Release rhythm 35
- Longevity 100
Flags: no_releases
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-02. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 3282
- days_rel: n/a
- days_push: 157
- n_releases_24m: 0
Adoption not part of the score
2030 stars · 157 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
A Laravel package providing a simple, extensible enumeration implementation with class constants, instantiation, flagged/bitwise enums, attribute casting, validation rules, and artisan generators. The README now recommends against using it for new projects since PHP 8.1 supports enums natively.
Use cases
- add enums to a Laravel app on PHP below 8.1
- validate request input against enum keys or values
- cast Eloquent model attributes to enum instances
- create flagged bitwise enum flags
- generate enum classes with an artisan command
- attach localized descriptions to enum values
When to choose
- you're on a legacy Laravel/PHP codebase predating PHP 8.1 native enums
- you need bitwise/flagged enums with helper methods
- you want enum-aware validation and attribute casting in Laravel
When to avoid
- starting a new project on PHP 8.1 or later — use native PHP enums
- you need a long-term maintained solution — the library is no longer recommended
Facets
library · maturity maintenance
developer-tools cli form-handling web-development developer-tools programming-languages php enum laravel-package bitwise-enum attribute-casting php-enums deprecated-in-favor-of-native-enums laravel
2 sources
- readme: https://github.com/BenSampo/laravel-enum · fetched 2026-08-28 · 667fe1ec58ae
- homepage: https://sampo.co.uk/blog/using-enums-in-laravel · fetched 2026-08-29 · 424fb9246bc1
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| BenSampo/laravel-enum | main | 66 |
For agents
markdown · JSON · MCP: product_card(name="BenSampo/laravel-enum")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem