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.

015PHP

Since Nov 6Pushed 6mo ago1 watchersCompare

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

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

19

—

LowBetter than 10% of packages

Maintenance47

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity13

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://www.gravatar.com/avatar/41fb2518f7461b7f32520ef21e322bd837a936ccab733efd2e01879e70f1ade8?d=identicon)[xgbnl](/maintainers/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)
```

###  Alternatives

[sallar/jdatetime

Jalali (Shamsi) DateTime class written in PHP, Supports year higher than 2038

18541.4k4](/packages/sallar-jdatetime)[nfephp-org/posprint

Thermal POS printer library

7131.7k2](/packages/nfephp-org-posprint)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)[amendozaaguiar/filament-route-statistics

Filament route statictics viewer

3225.0k1](/packages/amendozaaguiar-filament-route-statistics)[fof/drafts

Allow users to create post and discussion drafts

1771.1k5](/packages/fof-drafts)[inspiredminds/contao-wowjs

Integrates WOW.js for Contao content elements and form fields.

1813.0k](/packages/inspiredminds-contao-wowjs)

PHPackages © 2026

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