PHPackages                             sakanjo/laravel-easy-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. sakanjo/laravel-easy-enum

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

sakanjo/laravel-easy-enum
=========================

Easily work with enum.

v1.0.5(1mo ago)101.6k↓77.6%1MITPHPPHP ^8.2CI passing

Since Apr 19Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/sakanjo/laravel-easy-enum)[ Packagist](https://packagist.org/packages/sakanjo/laravel-easy-enum)[ GitHub Sponsors](https://github.com/sakanjo)[ RSS](/packages/sakanjo-laravel-easy-enum/feed)WikiDiscussions master Synced yesterday

READMEChangelog (6)Dependencies (10)Versions (7)Used By (1)

🔥 Easy enum
===========

[](#-easy-enum)

 [![Workflow status](https://camo.githubusercontent.com/8fd9d33bca1b93f8b5bf68f21edae0c7723b42c44ff196ffe055d1428a926018/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f73616b616e6a6f2f6c61726176656c2d656173792d656e756d2f74657374732e796d6c3f7374796c653d666f722d7468652d6261646765)](https://github.com/sakanjo/laravel-easy-enum/actions) [![Laravel v11.x](https://camo.githubusercontent.com/0581d0d8558ab4baac47111d76069ec290ecf507fe89383033098c54e0e85ebb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d7631312e782d4646324432303f7374796c653d666f722d7468652d6261646765266c6f676f3d6c61726176656c)](https://laravel.com) [![PHP 8.2](https://camo.githubusercontent.com/95275f89c84292d44179906cd7fecba6795cc62414fc389bb3031205fe046478/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322d3737374242343f7374796c653d666f722d7468652d6261646765266c6f676f3d706870)](https://php.net)

Easily work with enums.

> ✨ Help support the maintenance of this package by [sponsoring me](https://github.com/sponsors/sakanjo).

> Designed to work with **Laravel**, **Filament**, and more.

[![Preview](./art/preview.png)](./art/preview.png)

Table of Contents
=================

[](#table-of-contents)

- [Install](#-install)
- [Usage](#-usage)
    - [1. Create enum](#1-create-enum)
    - [2. Create lang file](#2-create-lang-file)
- [Methods](#-methods)
    - [getLabel](#getlabel)
    - [translated](#translated)
    - [is](#is)
    - [isNot](#isnot)
    - [tryFromName](#tryfromname)
    - [fromName](#fromname)
    - [names](#names)
    - [values](#values)
    - [options](#options)
    - [toHtml](#tohtml)
    - [resolveDisplayableValue](#resolvedisplayablevalue)
- [Practical examples](#-practical-examples)
    - [Filamentphp](#filamentphp)
        - [Enum](#enum)
        - [Resource](#resource)
    - [Laravel blade](#laravel-blade)
- [Support the development](#-support-the-development)
- [Credits](#%EF%B8%8F-credits)
- [License](#-license)

📦 Install
---------

[](#-install)

```
composer require sakanjo/laravel-easy-enum

```

🦄 Usage
-------

[](#-usage)

### 1. Create enum

[](#1-create-enum)

```
