mad-web/laravel-enum
A Laravel package that provides a lightweight enum implementation with model attribute casting, validation rules, translations, and helper methods for working with predefined values throughout your application.
lang/ files means translating a status badge or dropdown is a content change, not a deploy. That directly affects whether "add Spanish to the admin panel" is a half-day or a two-week roadmap item.make:enum generator is a process decision disguised as a tool — it says "every enum in this codebase looks the same and lives in the same place." Worth adopting for the convention even if the runtime features are thin.Consider it when:
Look elsewhere when:
Enum validation rule cover the large majority of this package's surface with zero dependency. This is the default recommendation.bensampo/laravel-enum, archtechx/enums) cover this with active maintenance.Adoption hygiene if you do proceed: pin the version; note that the package is small enough to vendor or fork outright (which is the real mitigation); add a test asserting every enum case has a label key, because missing translations fail silently in the UI.
To executives (one paragraph): This is a small developer-ergonomics library that makes status and type values in our code typed and their display labels translatable. The value is fewer production bugs from typos and invalid values, and cheaper localization of the admin surface. Cost is effectively zero and lock-in is negligible — the library is small enough that we could replace it in about a day. That low exit cost is the point: it is a convenience, not a platform. We should not build roadmap or commitments on top of it, and on any new service we'd use the language's built-in enums instead.
To engineering: It gives you a generated enum base class, Eloquent casting, and label lookups through lang/ files — the three things people hand-roll badly. The catch is that it predates native PHP 8.1 enums, and Laravel 9+ now ships the casting behavior natively. So the recommendation is: adopt it only where we're stuck on older Laravel/PHP, follow the pattern it enforces everywhere, and treat the package itself as disposable. Migration path to native enums is mechanical — the enum cases port directly, and the labels move to a match or a small helper. Budget roughly a day per service when we get there; it should be folded into existing work rather than scheduled as its own initiative.
How can I help you explore Laravel packages today?