PHPackages                             pelmered/enums - 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. pelmered/enums

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

pelmered/enums
==============

0.0.1(1y ago)01.2kMITPHPPHP ^8.4

Since May 5Pushed 10mo ago1 watchersCompare

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

READMEChangelog (1)Dependencies (10)Versions (2)Used By (0)

PHP Enums
=========

[](#php-enums)

A powerful collection of helpers and attributes for PHP backed enums.

[![Latest Version on Packagist](https://camo.githubusercontent.com/97574abdfc344f02d6fcedb7559acac226f3bbc0800d031755deaf7f5a62d6da/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70656c6d657265642f656e756d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pelmered/enums)[![Total Downloads](https://camo.githubusercontent.com/a8f618c01c2b239ad8111bbae8208ad9545b48ad38e4b0984ca0e1f9a564357f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70656c6d657265642f656e756d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pelmered/enums)[![MIT Licensed](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Introduction
------------

[](#introduction)

This package provides a set of utilities to enhance PHP backed enums with additional functionality such as descriptions, titles, and helper texts. It builds upon the native PHP enum functionality introduced in PHP 8.1 and adds developer-friendly features.

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

[](#requirements)

- PHP 8.4 or higher

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

[](#installation)

You can install the package via composer:

```
composer require pelmered/enums
```

Features
--------

[](#features)

- **Enhanced Enum Attributes**: Add descriptions, titles, and helper texts to your enum cases
- **Easy Conversion**: Transform enums to arrays, names, or values for use in forms, APIs, etc.
- **Extensible**: Built on top of [archtechx/enums](https://github.com/archtechx/enums) with additional features
- **Developer Friendly**: Simple API designed for practical use cases
- **Well Documented**: Comprehensive documentation with examples

Usage
-----

[](#usage)

### Creating Enhanced Enums

[](#creating-enhanced-enums)

To use the enum helpers, simply add the `EnumHelpers` trait to your enum and apply attributes to your cases:

```
