Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Enumerated Laravel Package

davidianbonner/enumerated

Enumerated brings first-class enum support to Laravel. Define backed enums and use them in Eloquent casts, validation rules, and form requests, with helpers for labels, options, and comparisons. Keeps domain values type-safe and readable.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Single source of truth for business vocabulary. Statuses, tiers, categories, and reason codes inevitably get duplicated across the database, API contracts, admin UI, and reporting. An enumerated-attribute package lets engineering define them once in a typed PHP class and reuse that definition for validation, Eloquent casting, labels, and translations — which directly reduces the "marketing says 'Cancelled', the app says 'CANCELED', finance's export says '3'" class of defects that PMs end up arbitrating.
  • Build vs. buy on a small but pervasive concern. The alternative is an internal trait/abstract class plus hand-rolled validation rules and casts. That is cheap to write and expensive to own (it drifts across teams, gets forked, and quietly breaks on framework upgrades). Adopting a maintained package moves that maintenance off your roadmap for the cost of one Composer dependency and a version-pinning policy.
  • Roadmap sequencing for anything with a lifecycle. If upcoming work involves plan tiers, subscription states, ordering/fulfilment states, or approval workflows, enum modeling is a prerequisite. Deciding this before building the feature is far cheaper than retrofitting typed states after the fact.
  • Scope control on "just add a dropdown" requests. A typed enumeration plus labels makes it explicit whether a new value is a config change or a code change, which clarifies delivery cost and release risk when a stakeholder asks for one more status.
  • Localization and customer-facing copy. Label/description attributes co-located with values mean UI strings and support-macro text can be reviewed by non-engineers and translated consistently, rather than living in scattered Blade templates.
  • API/contract stability. Enumerated values become an explicit, reviewable public contract — useful input to API versioning decisions and to any partner-integration commitments.

When to Consider This Package

Consider adoption when:

  • The domain has a bounded, slow-changing set of values (order status, plan tier, employment type) used in more than two places.
  • The team is on a supported Laravel and PHP version matching the package's v8 requirements, and is comfortable tracking a single-maintainer dependency.
  • You want validation rules and Eloquent casts out of the box rather than a bespoke internal library.
  • You need human-readable labels/descriptions and translations attached to machine values.
  • You value convention over configuration for new hires — a documented enum pattern beats five subtly different in-house ones.

Look elsewhere when:

  • Values are user-editable at runtime (tenant-defined categories, custom fields). These belong in the database, not in code; forcing them into a class creates a deploy-per-edit workflow.
  • Values are high-churn or high-cardinality (country lists, currency tables, compliance code sets). Use a reference data source or a maintained data package instead.
  • Your architecture already standardizes on native PHP 8.1+ backed enums and a thin internal helper; adding a wrapper may cost more in cognitive overhead than it saves.
  • You need guaranteed long-term maintenance and a security response SLA — assess maintainer responsiveness and release cadence first; a single-maintainer package in a regulated or high-availability context is a risk that must be consciously accepted.
  • You are mid-freeze on a major release; introduce it in a normal cycle where the version constraint can be pinned and regression-tested.

Release note for this cycle: v8.0.1 is a patch release on the v8 line. The published notes contain only a changelog link with no listed features, deprecations, or breaking changes, so it is treated as a low-risk bugfix/maintenance bump. Recommended action: pin to ^8.0.1 only after confirming the v8.0.0 upgrade path has already been validated (v8.0.0 was the major and is where requirement changes, if any, would live), and run the existing test suite against it. No roadmap or scope decisions change as a result of this release.

How to Pitch It (Stakeholders)

To executives: This is a small, low-cost dependency that standardizes how we name the states and categories our business runs on — order statuses, plan tiers, approval states. The value is fewer cross-system mismatches (support seeing one label while finance sees another), faster delivery of small changes like adding a new status, and cleaner reporting. Cost is one library and roughly a day of adoption work; the risk is manageable and contained by version pinning. The just-released v8.0.1 is a maintenance patch with no functional or breaking changes, so there is no decision required from you today.

To engineering: The proposal is to stop hand-rolling enum-like constants, validation in: rules, and accessor methods per feature. One typed class per concept, with attributes for label/description/meta, gives us Laravel validation and Eloquent casting for free and keeps customer-facing strings next to their values for translation. It fits as a light abstraction over native enums, so migration cost is per-feature, not a big-bang refactor. Ask: confirm framework/PHP version compatibility with v8, agree a constraint and Dependabot policy, and decide the boundary rule — code-defined enums for stable domain vocabulary, database tables for anything a customer or admin can edit.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package