PHPackages                             splitstack/enum-friendly-core - 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. splitstack/enum-friendly-core

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

splitstack/enum-friendly-core
=============================

A dependency-free PHP package that provides enhanced functionality for PHP enums including conversion utilities, validation helpers, and developer-friendly features

1.0.0(7mo ago)01.1k1MITPHPPHP ^8.1CI passing

Since Oct 2Pushed 7mo agoCompare

[ Source](https://github.com/EmilienKopp/EnumFriendlyCore)[ Packagist](https://packagist.org/packages/splitstack/enum-friendly-core)[ RSS](/packages/splitstack-enum-friendly-core/feed)WikiDiscussions main Synced 1mo ago

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

EnumFriendly Core
=================

[](#enumfriendly-core)

[![Tests](https://camo.githubusercontent.com/74ce33d9b283fe2a01cb28d7a702e16f8bf84f6b5f677034d79bb591634afafe/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f656d696c69656e6b6f70702f456e756d467269656e646c792f74657374732e796d6c3f6c6162656c3d7465737473)](https://camo.githubusercontent.com/74ce33d9b283fe2a01cb28d7a702e16f8bf84f6b5f677034d79bb591634afafe/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f656d696c69656e6b6f70702f456e756d467269656e646c792f74657374732e796d6c3f6c6162656c3d7465737473)

[![PHP Version](https://camo.githubusercontent.com/c3d372b55ac2d4fcf386a178e11d9788310097b35f3893cf3daae574b6b4cd3e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e312d626c75652e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/c3d372b55ac2d4fcf386a178e11d9788310097b35f3893cf3daae574b6b4cd3e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e312d626c75652e7376673f7374796c653d666c61742d737175617265)[![Framework Agnostic](https://camo.githubusercontent.com/c243f4ef2eabfe4337e200f4a89e364a89fa89b156d72a468692f0209048257a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6672616d65776f726b2d61676e6f737469632d677265656e2e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/c243f4ef2eabfe4337e200f4a89e364a89fa89b156d72a468692f0209048257a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6672616d65776f726b2d61676e6f737469632d677265656e2e7376673f7374796c653d666c61742d737175617265)[![Total Downloads](https://camo.githubusercontent.com/2a1c552cdcb5b7363dd26ad0ea0279058027f0fb5bbe0935f2de2467f90b120c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73706c6974737461636b2f656e756d2d667269656e646c792d636f72652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/splitstack/enum-friendly-core)

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

[](#introduction)

EnumFriendly Core is a powerful, **dependency-free** PHP package that enhances your enum experience across any PHP 8.1+ project. It provides a comprehensive set of utilities for working with enums, making them more versatile and easier to integrate with TypeScript, forms, APIs, and more.

**🚀 Key Features:**

- **Zero Dependencies** - Works with any PHP 8.1+ project, no framework required
- **Framework Agnostic** - Use with Laravel, Symfony, vanilla PHP, or any other framework
- **Comprehensive Enum Utilities** - Over 20 helpful methods for enum manipulation
- **TypeScript Integration** - Generate TypeScript-compatible type definitions
- **Developer Friendly** - Intuitive API with extensive documentation

With EnumFriendly Core, you can:

- Convert enum values to human-readable labels
- Generate TypeScript-compatible type definitions
- Create form-friendly select options
- Get random enum values for testing
- Safely coerce values to enum instances
- Check enum membership and filter cases
- And much more!

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

[](#installation)

You can install the package via composer:

```
composer require splitstack/enum-friendly-core
```

That's it! No configuration needed - the package is ready to use immediately.

Usage
-----

[](#usage)

### Adding the EnumFriendly Trait

[](#adding-the-enumfriendly-trait)

Simply add the `EnumFriendly` trait to your existing enums to unlock all the enhanced functionality:

```
