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.
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:
SuperchargedEnumsServiceProvider registered through Laravel package discovery). This is standard, low-friction Laravel packaging — no manual config/app.php edits, no custom bootstrap.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:
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.--force and reconciles diffs. This is the classic vendor-publish liability and needs an owner.Technical risk
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.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.resources/boost/ layout, which is the right mitigation. Risk is limited to agent-output quality, not application behavior.Key questions
0.x implies no semver guarantees — is the team prepared to pin tightly and schedule upgrades deliberately?EnumExtension change public method signatures in ways that would break consuming enums on minor upgrades? Is there a documented BC policy?use EnumExtension) or does it diverge from the framework default in other ways (interfaces, attributes, strict types)? Review the stub diff before publishing.resources/boost/ payload at all beyond acknowledging it exists?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:
EnumExtension on new enums only. Do not retro-fit existing enums in the same change.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
composer.json (version constraints, illuminate/* bounds, PHP floor) and CHANGELOG/tags.php artisan about or package listing shows the provider registered.enum.backed.stub before publishing — diff against the framework default.php artisan boost:install (or boost:update --discover) and confirm the skill/guidelines land; validate agent output on one enum task.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.
How can I help you explore Laravel packages today?