PHPackages                             upward/enumerables - 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. upward/enumerables

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

upward/enumerables
==================

Utils for enums

v1.0.3(1y ago)0162MITPHPPHP ^8.1

Since Oct 31Pushed 1y agoCompare

[ Source](https://github.com/upwardphp/enumerables)[ Packagist](https://packagist.org/packages/upward/enumerables)[ RSS](/packages/upward-enumerables/feed)WikiDiscussions 1.x Synced today

READMEChangelog (3)Dependencies (3)Versions (5)Used By (0)

Enumerables
===========

[](#enumerables)

A PHP/Laravel package that enhances Enum usage with various utilities like easy conversion, validation, and additional operations. Designed to streamline working with Enums in Laravel projects, Enumerables optimizes code for clarity and maintainability when handling constants and specific values.

Installation
------------

[](#installation)

To install the `Enumerables` package run the following command in your terminal:

```
composer require upward/enumerables
```

Features
--------

[](#features)

### Enum Case Attributes with Label

[](#enum-case-attributes-with-label)

The `Enumerables` package provides a way to add a `Label` attribute to your Enum cases, allowing you to define custom text for each case. This can be especially useful for displaying human-readable labels or translating Enum values.

#### Usage Example

[](#usage-example)

Here's how to use the `Label` attribute with an Enum case and retrieve the text:

```
use Upward\Enumerables\Attributes\Label;
use Upward\Enumerables\Traits\InteractsWithLabel;

enum Status
{
    use InteractsWithLabel;

    #[Label(text: 'Active')]
    case ACTIVE;

    #[Label(text: 'Inactive')]
    case INACTIVE;
}

// Accessing the label text
$status = Status::ACTIVE;
echo $status->getLabel(); // Outputs: Active
```

#### Example without Translation

[](#example-without-translation)

If you want to display the label without translation, set the `translate` option to false:

```
use Upward\Enumerables\Attributes\Label;
use Upward\Enumerables\Traits\InteractsWithLabel;

enum UserRole
{
    use InteractsWithLabel;

    #[Label(text: 'Administrator', translate: false)]
    case ADMIN;

    #[Label(text: 'Editor', translate: false)]
    case EDITOR;
}

$role = UserRole::ADMIN;
echo $role->getLabel(); // Outputs: Administrator
```

#### Note on Translation

[](#note-on-translation)

Translations are performed using the default Laravel `__()` function, allowing you to manage language files and translations easily.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance41

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~31 days

Total

5

Last Release

485d ago

### Community

Maintainers

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

---

Top Contributors

[![victorhbbergamo](https://avatars.githubusercontent.com/u/50025273?v=4)](https://github.com/victorhbbergamo "victorhbbergamo (8 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/upward-enumerables/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[illuminate/pagination

The Illuminate Pagination package.

12234.1M1.0k](/packages/illuminate-pagination)[illuminate/pipeline

The Illuminate Pipeline package.

9349.2M282](/packages/illuminate-pipeline)[illuminate/redis

The Illuminate Redis package.

8314.6M375](/packages/illuminate-redis)[illuminate/cookie

The Illuminate Cookie package.

244.6M137](/packages/illuminate-cookie)

PHPackages © 2026

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