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

Supercharged Enums Laravel Package

bensondevs/supercharged-enums

Supercharged Enums adds helpful, expressive methods to PHP 8.1+ enums so you can do more with less code in your Laravel apps. It keeps enum logic clean and readable, with a simple API for common tasks like labels, comparisons, and validation.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

supercharged-enums is a composer-installable Laravel package that layers behavior onto native PHP backed enums via an EnumExtension trait, plus Laravel-specific conveniences. The v0.2.0 release moves it from "a trait you use" to "framework-integrated tooling" in two ways:

  1. Auto-discovered service provider (SuperchargedEnumsServiceProvider registered through Laravel package discovery). This is standard, low-friction Laravel packaging — no manual config/app.php edits, no custom bootstrap.
  2. Artisan stub publishing (enum.backed.stub), which overrides the framework's default make:enum --string|--int output so newly generated enums arrive with EnumExtension pre-wired.

Conceptually, this is an additive developer-experience package: it does not alter the ORM, HTTP layer, queue, or container. The blast radius is limited to (a) enum classes that explicitly adopt the trait and (b) the make:enum generator once stubs are published. That is a favorable architecture profile for a TPM — adoption can be scoped per-domain rather than as an application-wide concern.

The Boost integration (resources/boost/, skill supercharged-enums-development, guidelines) is the more novel element. Laravel Boost is an AI-agent tooling layer; this package now ships agent-facing context that is auto-discovered by php artisan boost:install or boost:update --discover. For teams using agentic coding assistants, this measurably improves the quality of AI-generated enum code, because the agent is told how the trait works instead of guessing. For teams not using Boost, this is inert payload — a small amount of extra vendor content, no runtime cost.

Integration feasibility

High. The install path is conventional Composer + package discovery, and the stub workflow is explicitly opt-in and reversible (vendor:publish --tag=supercharged-enums-stubs). Nothing in the release notes suggests a required config publish, migration, or environment variable.

Two feasibility questions matter and are not answered by the release notes:

  • Stub override semantics. Publishing enum.backed.stub writes into the application's stubs/ directory. Laravel resolves app-level stubs ahead of package stubs, so this takes effect globally for every subsequent make:enum. That is the intended behavior, but it means a single developer running the publish command changes generator output for the whole team. This is a shared-state side effect, not a local one — worth calling out explicitly in the adoption runbook.
  • Stub drift. Once published, the app owns a copy of the stub. Future package releases that change the stub template will not reach the app until someone re-publishes with --force and reconciles diffs. This is the classic vendor-publish liability and needs an owner.

Technical risk

  • Low: Composer install and service provider auto-discovery — well-trodden Laravel mechanics.
  • Low–medium: Trait coupling on enum classes. If EnumExtension later gains required methods or changes a method signature, every consuming enum is a compile-time surface. Enums are typically domain primitives (statuses, types, currencies), so breakage propagates into serialization, validation rules, and DB casts at once.
  • Medium: Generator behavior change via published stub. Silent in code review — a developer runs make:enum and gets a subtly different class than a teammate on an un-published stub. This is a consistency risk across branches and CI-generated scaffolding, not a runtime risk.
  • Low: Boost resource structure. The release includes validation tests for the resources/boost/ layout, which is the right mitigation. Risk is limited to agent-output quality, not application behavior.

Key questions

  1. What is the package's stability/versioning posture? 0.x implies no semver guarantees — is the team prepared to pin tightly and schedule upgrades deliberately?
  2. Does EnumExtension change public method signatures in ways that would break consuming enums on minor upgrades? Is there a documented BC policy?
  3. Is the published stub additive-only (adds use EnumExtension) or does it diverge from the framework default in other ways (interfaces, attributes, strict types)? Review the stub diff before publishing.
  4. Who owns stub re-publishing when the package ships stub changes? What triggers that review?
  5. Are we a Boost shop? If not, do we care about the resources/boost/ payload at all beyond acknowledging it exists?
  6. What Laravel and PHP minimum versions does v0.2.0 require, and does that align with our current runtime?

Integration Approach

Stack fit

Good fit for a convention-driven Laravel codebase. The package's value proposition — reducing enum boilerplate and standardizing how enums behave across the app — aligns with teams that already lean on Laravel's generators and package discovery. It is a poor fit only if the organization deliberately restricts third-party packages that hook the Artisan generator, or if enums are considered a frozen domain primitive layer that shouldn't carry external trait dependencies.

Migration path

Adoption is incremental and does not require a flag day:

  1. Add the dependency and let package discovery register the service provider. No manual wiring.
  2. Adopt EnumExtension on new enums only. Do not retro-fit existing enums in the same change.
  3. Publish stubs as a separate, explicitly-reviewed commit once the stub diff is understood.
  4. Retro-fit existing enums later, domain by domain, with each enum's consumers (casts, validation rules, API resources, factories) reviewed in the same PR.

There is no data migration, no schema change, and no config surface described in the release notes — which keeps the migration cheap.

Compatibility

The primary compatibility axis is PHP version and Laravel version support, neither of which is stated in the release notes. Backed enums require PHP 8.1+ as a floor. Laravel package discovery requires Laravel 5.5+ but the practical floor will be dictated by the package's own composer.json. Confirm before commit.

Secondary compatibility concern: published stubs are Laravel-version-sensitive. If the framework changes its default enum stub in a future release, our published copy will silently lag and generate stale scaffolding. Pair any Laravel major upgrade with a stub review.

Sequencing

  1. Read composer.json (version constraints, illuminate/* bounds, PHP floor) and CHANGELOG/tags.
  2. Install on a scratch branch. Verify php artisan about or package listing shows the provider registered.
  3. Inspect the shipped enum.backed.stub before publishing — diff against the framework default.
  4. Pilot on one low-risk new enum in a single domain. Exercise its consumers (cast, validation, serialization, factory).
  5. If Boost is in use, run php artisan boost:install (or boost:update --discover) and confirm the skill/guidelines land; validate agent output on one enum task.
  6. Publish stubs repo-wide with a dedicated PR and a note in the team's onboarding doc.
  7. Retro-fit legacy enums as opportunistic cleanup, never as a standalone refactor sprint.

Operational Impact

Maintenance

Ongoing cost is modest but nonzero. The two recurring chores are (a) tracking package releases, particularly any change to EnumExtension's public surface, and (b) re-publishing the stub when the package updates its template. Both are calendar-driven, easily forgotten, and best owned by a named individual rather than "the team." Pin the dependency at a specific version and upgrade deliberately rather than floating, given the 0.x version.

The published stub becomes application-owned source. Treat it as such: it lives in stubs/, it is reviewed like code, and it is covered by a smoke test that generates an enum and asserts it compiles and carries the trait.

Support

Support burden is low and mostly internal. Developers will ask two questions: "which enums should use the trait?" and "why does my generated enum look different from what the docs show?" The first needs a written convention (new enums yes, legacy enums on touch). The second is answered by documenting that the stub is published and repo-local.

No new runtime services, no external API dependencies, no credentials. This package will not page anyone. The Boost skill is documentation-shaped content for AI agents; it requires no operational support and its failure mode is degraded agent output, not application failure.

Scaling

Scales linearly with enum count and horizontally with team size at negligible cost — the trait is pure PHP with no I/O, no caching layer, no allocation concerns. The one scaling wrinkle is team coordination, not infrastructure: as headcount grows, the probability that someone runs make:enum against a stale stub or adds an enum without the trait increases. Mitigate with a lint/CI check that asserts generated enums carry the expected trait, or a short PR checklist item. This is cheap insurance and the single highest-leverage operational investment for this package.

Failure modes

Failure Blast radius Detection Mitigation
EnumExtension BC break in a minor release All consuming enums fail to compile CI, immediately Pin version; review changelog before upgrading
Stale published stub after package/Laravel upgrade Newly generated enums diverge from expectation Code review, drift Stub review paired with every Laravel major upgrade
Developer forgets to publish stubs locally Their generated enums lack the trait Inconsistent code review Document in onboarding; CI trait check
Un-published stub on one branch, published on another Merge-time inconsistency in generated files PR diff Publish via dedicated PR, announce it
Boost skill not discovered Degraded AI-generated enum code Agent output quality Run boost:install post-install; treat as developer-env concern
Package abandoned upstream Slow drift to irrelevance Quarterly dependency review Trait is thin and portable; exit cost is low

The encouraging property here is that every failure mode is a developer-experience failure, not a production failure. There is no path by which this package takes down a request, corrupts data, or degrades latency. That materially lowers the risk ceiling and justifies a lightweight approval process.

Ramp-up

Near zero. A Laravel developer can adopt this in under an hour: install, publish, generate one enum, read the trait. The Boost integration adds no learning curve for developers who don't use agentic tooling, and a small one (one boost:install run) for those who do.

Recommended onboarding artifacts: a two-paragraph README note on when to use the trait, a one-line CI check for the trait on generated enums, and a calendar reminder owned by one engineer to review the package and stub on each Laravel major upgrade. Total setup effort: roughly half a day, mostly review and documentation rather than implementation.

TPM recommendation: Approve for adoption on new enums with a pinned version and a named stub owner. Defer retro-fitting existing enums to opportunistic cleanup. Treat the Boost integration as a developer-environment nicety to be validated only if the team already uses Boost — it is not a reason to adopt the package on its own, and it is not a reason to block. The decisive questions before merge are the package's composer.json version bounds and the actual stub diff, neither of which the release notes answer.

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.
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels