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

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

synergitech/laravel-magic-enums
===============================

A Laravel package that adds extra power to your PHP enums, and lets you use them in your frontend with type definitions.

v3.0.3(4mo ago)95.7k↓36.3%[2 PRs](https://github.com/SynergiTech/laravel-magic-enums/pulls)MITPHPPHP ^8.2CI passing

Since May 29Pushed 3mo ago4 watchersCompare

[ Source](https://github.com/SynergiTech/laravel-magic-enums)[ Packagist](https://packagist.org/packages/synergitech/laravel-magic-enums)[ Docs](https://github.com/SynergiTech/laravel-magic-enums)[ RSS](/packages/synergitech-laravel-magic-enums/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (7)Versions (12)Used By (0)

[![JS Tests](https://github.com/SynergiTech/laravel-magic-enums/actions/workflows/js-test.yaml/badge.svg?branch=main)](https://github.com/SynergiTech/laravel-magic-enums/actions/workflows/js-test.yaml)[![PHP Tests](https://github.com/SynergiTech/laravel-magic-enums/actions/workflows/php-test.yaml/badge.svg)](https://github.com/SynergiTech/laravel-magic-enums/actions/workflows/php-test.yaml)

Laravel Magic Enums
===================

[](#laravel-magic-enums)

Have you ever wanted to reference your PHP enums in your frontend code but ended up (or didn't want to end up) duplicating them manually? Well here is your answer.

Installing
----------

[](#installing)

You need both sides to get started.

```
$ composer require synergitech/laravel-magic-enums
$ npm install --save laravel-magic-enums
```

Getting Started
---------------

[](#getting-started)

1. Add the trait and interface from this package to your enums. We recommend you don't include sensitive information in your enums.

```
