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

Myclabs Enum Param Converter Laravel Package

ex3v/myclabs-enum-param-converter

A Symfony bundle that adds seamless MyCLabs\Enum parameter conversion in controllers. Install via Composer, register the bundle, typehint enum arguments in actions, and conversion happens automatically.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Where coercion lives: decides whether route-parameter-to-enum mapping is a framework concern (a ParamConverter) or per-controller boilerplate (BarType::from($request->get('type')) wrapped in try/catch). This package argues for the framework layer.
  • Public API error contract: ParamConverter failures surface as 404, not 500 or 422. That is a real, user-visible decision about how clients interpret a bad enum value — worth ratifying explicitly rather than inheriting from a third-party bundle.
  • Build vs. buy for glue code: the entire feature is a small type-hinted adapter. The genuine options are (a) add this dependency, (b) vendor ~40 lines into src/, or (c) use the framework's native resolver. This is a low-stakes decision that reveals whether the team has a dependency-adoption policy at all.
  • Domain boundary posture: supports type-hinted value objects in controller signatures instead of stringly-typed scalars, which matters if the roadmap includes tightening the domain layer.
  • Sequencing of the enum migration: MyCLabs\Enum is end-of-life; PHP 8.1 native backed enums superseded it years ago. Any adoption decision here is really "how much longer do we keep MyCLabs\Enum," which should be an input to a modernization roadmap item, not a standalone choice.
  • A correction to the brief: this is a Symfony bundle, not a Laravel package — no service provider, no config/ publish step, just AppKernel::registerBundles(). If the roadmap or this evaluation assumes Laravel, the package is simply inapplicable and the decision is closed.

When to Consider This Package

Adopt only under a narrow set of conditions:

  • A legacy Symfony 3.4/4.x application on PHP 7.2–7.4, with MyCLabs\Enum subclasses already threaded through many controllers, where the boilerplate is recurring and measurable.
  • You want the DX improvement without owning the converter code, and you can accept a frozen, unsupported dependency.

Look elsewhere — or skip entirely — if:

  • You are on Laravel. It will not work. No amount of configuration changes that.
  • You are on Symfony 6.2+. The framework's native BackedEnumValueResolver does this for native backed enums, and #[MapQueryString]/#[MapRequestPayload] cover adjacent cases.
  • You are greenfield or already on PHP 8.1+ native enums. Investing in MyCLabs\Enum tooling is investing in the thing you are migrating away from.
  • You need enum coercion from JSON request bodies or query strings rather than route attributes. Different mechanism.
  • You have any dependency-health gate. 8 stars, 0 dependents, a single maintainer, and a Travis CI badge for a shut-down service are three independent signals of abandonment. Score 0.17 is accurate.

Recommended path in every case where the feature is wanted: copy the converter into your own codebase. It is small, it eliminates the supply-chain and PHP-version-upgrade risk, and it preserves the exact developer experience.

How to Pitch It (Stakeholders)

To executives: This is a small developer-experience utility. It removes a few lines of validation and try/catch from each endpoint that accepts an enum in the URL, and it standardizes a 404 for invalid values. The upside is modest and the cost is near zero — but the vendor is one unmaintained repository with no downstream users. Recommendation: do not add it as a dependency; spend half a day reproducing the behavior internally and keep the benefit without the risk.

To engineering: Symfony ParamConverter adapter for MyCLabs\Enum — explicitly not Laravel. Do not add it to composer.json if you are on Symfony 6.2+ (use BackedEnumValueResolver with native backed enums) or if a PHP 8.1 enum migration is anywhere on the roadmap. If the legacy application genuinely needs it, vendor the converter class into src/ and move on.

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.
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel