Weave Code
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.
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager