sourceboat/laravel-enumeration
A Laravel package for defining and using enumerations in PHP, with support for validation rules, model casting, and comparing enum values in a clean, type-safe way across your application.
Rule::enum validation now cover much of this package's surface area. This is a direct input into upgrade sequencing: migrating to modern PHP may retire the dependency entirely.label(), color(), and options() helpers reduce duplicate presentation logic across admin panels, exports, and client payloads — a lever on both consistency bugs and delivery speed for CRUD-heavy features.OrderStatus::Shipped vs. 'shipped'), which affects onboarding time and defect rates in workflow-heavy modules.Consider it when:
eloquent/enumeration value-object pattern, and this package is a thin, compatible extension of that convention.Look elsewhere when:
casts, and Rule::enum cover the majority of the use case with no third-party surface area.spatie/laravel-enum or BenSampo/laravel-enum have materially larger communities and release cadence.For executives: This is a small, low-cost utility that makes finite business states — order status, subscription lifecycle, payment outcomes — explicit in code instead of loose strings. The business payoff is fewer production defects from invalid or misspelled states and more consistent labels across admin tools, exports, and customer-facing surfaces. The cost is negligible and the replacement cost is equally negligible, so it is a low-risk, reversible decision. The main caveat is that the package has essentially no adoption or maintenance signal, so it should be treated as code we own rather than a supported vendor dependency — and on modern PHP it is largely superseded by language-level enums.
For engineering: Evaluate it as a convenience layer over eloquent/enumeration, not as a strategic dependency. Recommended path: pilot it in a single bounded domain (e.g., order status) behind a thin internal interface, confirm the label/options/casting ergonomics actually beat native backed enums in our code, and record the migration path to native enums if we later drop it. Absent a strong ergonomic win on a pre-8.1 codebase, prefer native enums plus Laravel casting and validation — fewer moving parts, no fork obligation, no supply-chain review.
How can I help you explore Laravel packages today?