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

Enum Field Laravel Package

suleymanozev/enum-field

Enum Field for Filament provides a simple Laravel form component that turns PHP enums into selectable options, with support for labels, colors, and validation so enum-backed values are easy to manage in Filament admin panels.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

What the package is. suleymanozev/enum-field is a Laravel Nova form field whose stated purpose is rendering PHP enum cases in the Nova admin UI. Nova custom fields are structurally thin: a PHP class extending Laravel\Nova\Fields\Field (typically $component = 'enum-field', plus resolve/fillUsing/displayUsing hooks) and a compiled Vue component registered through Nova::script() / Nova::style() in the service provider. The surface area is small, which caps both the upside and the blast radius.

Architecture fit. Only relevant if we already run Nova — a paid, closed-source product with a per-site license. If our admin layer is Filament, Blade, Inertia, or Livewire, this package is inapplicable and the evaluation ends there. Even inside a Nova estate, the fit is narrow: Nova's built-in Select field plus Eloquent's native enum casting (protected $casts = ['status' => Status::class]) already covers the majority of enum-editing use cases. The package only earns its place if it adds something Select does not: label resolution via a HasLabel interface, automatic rule generation from Enum::cases(), index-column formatting, or enum-aware filtering.

Integration feasibility. Mechanically easy — Composer install, service provider auto-discovery, optional nova:publish for assets. The real gate is version-matrix compatibility: PHP 8.1+ (enums), the Laravel major we run, and critically the Nova major (4 vs 5 have divergent field APIs and Vue versions). Nova itself installs from a private Composer repository requiring license credentials, which means CI and onboarding pipelines need that credential plumbed through regardless.

Technical risk. High relative to value, driven almost entirely by provenance rather than code:

  • Unvetted supply chain into the highest-privilege surface we own. A Nova field ships PHP that executes inside an authenticated admin panel with broad Eloquent access. A package with no observable stars, no dependents, no visible test suite, and no security-advisory coverage is a poor trade for saving a few hours of field development.
  • Single-maintainer abandonment. No dependents means no downstream pressure to fix a Nova upgrade, no community forks to lean on, and no signal that anyone will respond to an issue. If Nova 6 changes the field contract, we inherit the fix.
  • Asset-build ambiguity. Many small Nova field packages either omit dist/ assets or ship prebuilt bundles of unknown provenance. An unbuilt component manifests as a silently blank field, which is a confusing failure to diagnose mid-release.
  • Metric ambiguity. The empty star count and Score: 0 look like incomplete scraping rather than a genuinely zeroed repo. Either way, there is no observable adoption to weigh.

Note the runtime risk is low: the code is small, deterministic, and UI-scoped. The risk is governance, not correctness.

Key questions before any further investment.

  1. What are the explicit composer.json constraints for php, laravel/framework, and laravel/nova? Is Nova 5 supported?
  2. Does the repo commit compiled dist/js and dist/css, or require a local Node build?
  3. Is there a test suite and CI? What is the declared license, and is it compatible with our distribution model?
  4. How does it handle non-backed (pure) enums, nullable enum columns, and a DB value whose case has since been removed from the enum?
  5. Does it generate validation rules, and does it interact correctly with Nova filters, sorting, and displayUsing on index/detail?
  6. Commit history and issue responsiveness: is this actively maintained or a single-push repo?

Integration Approach

Recommendation: do not adopt as a dependency. The capability gap it closes is 2–4 hours of in-house work, and the cost of ownership — an unmaintained third-party package inside the admin panel, plus fork maintenance at the next Nova major — exceeds that. Two acceptable paths, in preference order:

Path A — native Nova Select (preferred, zero new dependencies).

  1. Rely on Eloquent enum casting; the cast handles hydration and persistence.
  2. Register Select::make('Status')->options(Status::labels()) where labels() is a small static helper on the enum (or a HasLabel trait we own).
  3. Add ->displayUsing(fn ($value) => $value?->label()) for index/detail rendering and a Nova Filter for enum-scoped list views.
  4. Ship it as a shared EnumSelect factory in our own app/Nova/Fields namespace so every resource gets consistent behaviour.

Path B — fork and vendor, if the package genuinely does more than Select.

  1. Fork into our own namespace/VCS, pin to a commit SHA, and audit the field class and Vue component before first deploy.
  2. Commit built assets; wire them through our asset pipeline so nova:publish is not a manual step.
  3. Add a smoke test asserting the field renders options for a representative enum and that an unknown legacy DB value degrades to a readable placeholder rather than throwing.

Stack fit and compatibility checks. Confirm PHP ≥ 8.1, our Laravel major, and Nova major against the package constraints before anything else. Validate behaviour on: nullable enums, pure enums, int-backed enums, and enums whose cases carry per-case metadata. Confirm the component works under our CSP if we enforce one.

Migration path. There is nothing to migrate from — this is greenfield field adoption. If we ever want off it, swapping a custom field for Select is a per-resource edit, reversible in an afternoon. That reversibility is precisely why Path A is safe to choose now.

Sequencing. Do this outside a feature release: one PR adding the field factory plus enum label helpers, one PR converting resources, one PR adding a filter. No coupling to schema or migration work.

Operational Impact

Maintenance. Path A is effectively zero marginal cost — it lives in our codebase, inherits our linting and tests, and moves with our Laravel/Nova upgrades on our schedule. Path B costs a fork to track: cheap per year, but non-zero, and it silently rots until a Nova upgrade forces the issue.

Support. With no maintainer community, support is entirely internal regardless of path. That asymmetry — same support burden, but one option adds a third-party dependency — is the core argument against adoption.

Scaling. Negligible. This is presentation-layer code over a fixed enum set; no query, memory, or throughput implications. If anything, generating options from Enum::cases() is cheaper and safer than hand-maintained option arrays, which is the one genuine correctness win on offer.

Failure modes to watch.

  • Orphaned DB values. A case removed from the enum while rows still hold the old backing value causes a ValueError during hydration, surfacing as a 500 on the Nova index rather than a form-level validation error. Mitigate with a data migration on every enum change and a defensive accessor.
  • Blank field on deploy. Unbuilt or unregistered assets render an empty component with no console error visible to non-developers.
  • Silent cast mismatch. Int-backed enums submitted as strings through the field persist as the wrong value unless fillUsing normalizes.
  • Nova major upgrade breakage. The field contract and underlying Vue version shift; with no upstream, we patch it ourselves.

Ramp-up. Under an hour for any Laravel developer familiar with Nova — the field API is declarative and the enum side is standard PHP 8.1. Document the enum-label convention in the engineering handbook so new resources use the shared factory rather than reaching for raw string options.

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