PHPackages                             xgbnl/enum - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. xgbnl/enum

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

xgbnl/enum
==========

Laravel-based Enum Component.

019PHP

Since Jul 2Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/xgbnl/laravel-enum)[ Packagist](https://packagist.org/packages/xgbnl/enum)[ RSS](/packages/xgbnl-enum/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Enum
------------

[](#laravel-enum)

Install

```
composer require xgbnl/enum dev-main
```

#### Simple

[](#simple)

Create enum.

```
php artisan make:enum TestEnum
```

Define your Enums

```
use Elephant\Enums\Attributes\Description;
use Elephant\Enums\Contacts\Presenter;
use Elephant\Enums\Contacts\Enumerable;
use Elephant\Enums\Traits\GetsAttributes;
use Elephant\Enums\Traits\HasMethods;

Enums TestEnum:string implements Enumserable,Presenter
{
    use HasMethods,GetsAttributes;

    #[Description('my_foo')]
    case Foo = 'foo';

    #[Description('my_bar')]
    case Bar = 'bar';
}
```

**Method**

```
\Elephant\Test\Unit\TestEnum::Bar->description(); // 'my_bar'

\Elephant\Test\Unit\TestEnum::Bar->toViewModel(); // ['label' => 'Bar' 'value' => 'bar']

// ... more method.

\Elephant\Test\Unit\TestEnum::toArray();

\Elephant\Test\Unit\TestEnum::names();

\Elephant\Test\Unit\TestEnum::values();
```

#### License

[](#license)

MIT

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance43

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/52394568?v=4)[Daifei](/maintainers/xgbnl)[@xgbnl](https://github.com/xgbnl)

---

Top Contributors

[![xgbnl](https://avatars.githubusercontent.com/u/52394568?v=4)](https://github.com/xgbnl "xgbnl (39 commits)")

### Embed Badge

![Health badge](/badges/xgbnl-enum/health.svg)

```
[![Health](https://phpackages.com/badges/xgbnl-enum/health.svg)](https://phpackages.com/packages/xgbnl-enum)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
