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

Ex3v\MyCLabsEnumParamConverterBundle

A simple Symfony bundle to enable seamless MyClabs\Enum param conversion in your controllers.

Build Status

Installation and usage

1. Install via composer:
composer require ex3v/myclabs-enum-param-converter
2. Enable bundle:
<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new \Ex3v\MyCLabsEnumParamConverterBundle\MyCLabsEnumParamConverterBundle(),
    );
}
3. Use in your controller:
/**
 * @ParamConverter("barType")
 */
public function fooAction(BarType $barType) : Response
{
	//...	
}

Note that you do not have to point out specific converter as long as you use typehints in your controller actions.

If you want to point out this converter explicitly, use following example:

/**
 * @ParamConverter("barType", converter="converter_enum")
 */
public function fooAction(BarType $barType) : Response
{
	//...	
}

Happy coding!

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.
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log
hsluv/hsluv
seampact/codegen
seampact/hooks
seampact/ir
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table