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

Enumhancer Laravel Package

henzeb/enumhancer

View on GitHub
Deep Wiki
Context7

Labels

Just like Spatie's PHP Enum, you can add labels to your enums. This is largely backwards compatible with their package, except that it also works for basic enums in which case it returns the name if not specified.

Usage

use Henzeb\Enumhancer\Concerns\Labels;

enum YourEnum {
    use Labels;

    case ENUM;
    case NO_LABEL;

    public static function labels(): array
    {
        return [
            'ENUM' => 'Your label';
        ];
    }
}

Examples

YourEnum::ENUM->label(); // will return 'Your label'
YourEnum::NO_LABEL->label(); // will return 'NO_LABEL';
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.
htinlynn/genius-helper
maco-studios/hephaestus
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