PHPackages                             modstore/laravel-enum-js - 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. modstore/laravel-enum-js

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

modstore/laravel-enum-js
========================

Package to generate javascript versions of your PHP enum files to be used in your js builds etc.

1.0.12(4mo ago)15157.4k↓40.6%7[1 PRs](https://github.com/modstore/laravel-enum-js/pulls)MITPHPPHP ^8.0|^8.1

Since Sep 7Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/modstore/laravel-enum-js)[ Packagist](https://packagist.org/packages/modstore/laravel-enum-js)[ Docs](https://github.com/modstore/laravel-enum-js)[ RSS](/packages/modstore-laravel-enum-js/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (8)Dependencies (3)Versions (14)Used By (0)

Laravel Enum Js
===============

[](#laravel-enum-js)

Package to generate javascript versions of your PHP enum files to be used in your js builds etc. Works with Php8.1+ enums, constants in your PHP files, or you can use a package such as

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

[](#installation)

You can install the package via composer:

```
composer require modstore/laravel-enum-js
```

Publish the config:

```
php artisan vendor:publish --provider="Modstore\LaravelEnumJs\LaravelEnumJsServiceProvider"

```

Usage
-----

[](#usage)

Create a storage location, the path the generated files will be saved to.

```
// config/filesystems.php
...
'disks' => [
    'enum-js' => [
        'driver' => 'local',
        'root' => resource_path() . '/js/enums',
    ],
],
...
```

Check the other configuration options in the config file.

You can generate the js files by running the following Artisan command:

```
php artisan enum-js:generate
```

NOTE: When developing, if you create a new file, you will likely need to dump the autoload files before this command will pick it up, e.g.

```
composer dump-autoload
php artisan enum-js:generate
```

You can then use the generated files in your javascript like so:

```
import * as Status from '../enums/Status'

if (this.status === Status.Active) {
    // Do something.
}
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Mark Whitney](https://github.com/modstore)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

55

—

FairBetter than 97% of packages

Maintenance74

Regular maintenance activity

Popularity43

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 65.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~165 days

Recently: every ~282 days

Total

13

Last Release

141d ago

PHP version history (3 changes)1.0.0PHP ^7.1

1.0.5PHP ^7.1|^8.0|^8.1

1.0.11PHP ^8.0|^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7380420?v=4)[modstore](/maintainers/modstore)[@modstore](https://github.com/modstore)

---

Top Contributors

[![modstore](https://avatars.githubusercontent.com/u/7380420?v=4)](https://github.com/modstore "modstore (23 commits)")[![rgilbert-digistorm](https://avatars.githubusercontent.com/u/79557226?v=4)](https://github.com/rgilbert-digistorm "rgilbert-digistorm (4 commits)")[![agustinzamar](https://avatars.githubusercontent.com/u/36794905?v=4)](https://github.com/agustinzamar "agustinzamar (3 commits)")[![edwinrocketcode](https://avatars.githubusercontent.com/u/173076543?v=4)](https://github.com/edwinrocketcode "edwinrocketcode (1 commits)")[![mellester](https://avatars.githubusercontent.com/u/609138?v=4)](https://github.com/mellester "mellester (1 commits)")[![riks1233](https://avatars.githubusercontent.com/u/32734275?v=4)](https://github.com/riks1233 "riks1233 (1 commits)")[![bentleyo](https://avatars.githubusercontent.com/u/1701266?v=4)](https://github.com/bentleyo "bentleyo (1 commits)")[![chaker2710](https://avatars.githubusercontent.com/u/46485085?v=4)](https://github.com/chaker2710 "chaker2710 (1 commits)")

---

Tags

modstorelaravel-enum-js

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/modstore-laravel-enum-js/health.svg)

```
[![Health](https://phpackages.com/badges/modstore-laravel-enum-js/health.svg)](https://phpackages.com/packages/modstore-laravel-enum-js)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[illuminate/pagination

The Illuminate Pagination package.

12234.1M1.0k](/packages/illuminate-pagination)[illuminate/pipeline

The Illuminate Pipeline package.

9349.2M282](/packages/illuminate-pipeline)[illuminate/redis

The Illuminate Redis package.

8314.6M375](/packages/illuminate-redis)[illuminate/cookie

The Illuminate Cookie package.

244.6M137](/packages/illuminate-cookie)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
