PHPackages                             mahmudul/lara-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. mahmudul/lara-enum

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

mahmudul/lara-enum
==================

A lightweight Laravel enum enhancement package with labels, descriptions and helpers.

v1.0.1(6mo ago)2146MITPHPPHP ^8.4CI passing

Since Nov 9Pushed 6mo agoCompare

[ Source](https://github.com/Pondit-Hasan/lara-enum)[ Packagist](https://packagist.org/packages/mahmudul/lara-enum)[ Docs](https://github.com/Pondit-Hasan/lara-enum)[ RSS](/packages/mahmudul-lara-enum/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

Lara Enum
=========

[](#lara-enum)

Laravel custom enum utilities that add helpful attributes and helpers to your native PHP 8.1+ enums. Provides:

- A Description attribute you can place on enum cases for human-friendly labels
- A Translatable attribute to localize labels via a translation key (uses Laravel's \_\_() helper)
- A HasEnumAttributes trait that gives you convenient helpers like label(), values(), and asOptions()

Requirements
------------

[](#requirements)

- PHP: ^8.4
- Illuminate Support: ^12.0 or ^13.0 (works in Laravel applications using these versions)

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

[](#installation)

Install via Composer:

```
composer require mahmudul/lara-enum
```

The package uses Laravel package auto-discovery. No manual provider registration is needed.

Usage
-----

[](#usage)

### 1) Define your enum

[](#1-define-your-enum)

Add the Description or Translatable attribute to cases and use the HasEnumAttributes trait to gain helpers.

```
