PHPackages                             kongulov/interact-with-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. kongulov/interact-with-enum

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

kongulov/interact-with-enum
===========================

Trait for convenient use of ENUM in PHP

1.1.0(1y ago)3052.3k—0.8%2MITPHPPHP ^8.1

Since Jun 28Pushed 1y ago2 watchersCompare

[ Source](https://github.com/kongulov/interact-with-enum)[ Packagist](https://packagist.org/packages/kongulov/interact-with-enum)[ Docs](https://github.com/kongulov/interact-with-enum)[ GitHub Sponsors](https://github.com/kongulov)[ RSS](/packages/kongulov-interact-with-enum/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (2)

Interact With Enum in PHP
=========================

[](#interact-with-enum-in-php)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9da0e8874f495c559a3882d8e52be470e99f5b713df51bca69039c9f1e0474c4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b6f6e67756c6f762f696e7465726163742d776974682d656e756d3f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kongulov/interact-with-enum)[![Licence](https://camo.githubusercontent.com/ac9634a3e73010135aea19c8897eaf693aacdb79603e4730053f44b4a650ab8e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6b6f6e67756c6f762f696e7465726163742d776974682d656e756d3f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/ac9634a3e73010135aea19c8897eaf693aacdb79603e4730053f44b4a650ab8e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6b6f6e67756c6f762f696e7465726163742d776974682d656e756d3f7374796c653d666c61742d737175617265)[![Total Downloads](https://camo.githubusercontent.com/5cf5410d5714421b6aecfc096d63a4cba4af4228040d9c771e7640c0b8d2b11e/68747470733a2f2f706f7365722e707567782e6f72672f6b6f6e67756c6f762f696e7465726163742d776974682d656e756d2f646f776e6c6f6164733f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/kongulov/interact-with-enum)

This package contains the `InteractWithEnum.php` trait, which you can use to conveniently work with ENUMs.

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

[](#requirements)

- `php: >=8.1`

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

[](#installation)

Install the package via Composer:

```
# Install interact-with-enum
composer require kongulov/interact-with-enum
```

Usage
-----

[](#usage)

Imagine you have ENUM `StatusEnum.php` where we already use the `InteractWithEnum` trait:

```
