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.
BarType::from($request->get('type')) wrapped in try/catch). This package argues for the framework layer.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.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.config/ publish step, just AppKernel::registerBundles(). If the roadmap or this evaluation assumes Laravel, the package is simply inapplicable and the decision is closed.Adopt only under a narrow set of conditions:
MyCLabs\Enum subclasses already threaded through many controllers, where the boilerplate is recurring and measurable.Look elsewhere — or skip entirely — if:
BackedEnumValueResolver does this for native backed enums, and #[MapQueryString]/#[MapRequestPayload] cover adjacent cases.MyCLabs\Enum tooling is investing in the thing you are migrating away from.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.
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.
How can I help you explore Laravel packages today?