PHPackages                             xidanko/ts-enums-generator - 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. xidanko/ts-enums-generator

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

xidanko/ts-enums-generator
==========================

Generates typescript enums from php enums.

v1.0.2(1y ago)050MITPHPPHP &gt;=8.1

Since Jan 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/XiDanko/ts-enums-generator)[ Packagist](https://packagist.org/packages/xidanko/ts-enums-generator)[ RSS](/packages/xidanko-ts-enums-generator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

ts-enums-generator
==================

[](#ts-enums-generator)

`ts-enums-generator` is a Laravel package that generates TypeScript enums from PHP enums. It replicates the folder structure of the source directory using customizable naming conventions.

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

[](#installation)

To install the package, use Composer:

```
composer require xidanko/ts-enums-generator
```

Configuration
-------------

[](#configuration)

You can publish the configuration file using the following command:

```
php artisan vendor:publish --tag=ts-enums-generator-config
```

Usage
-----

[](#usage)

To generate TypeScript enums from PHP enums, use the following command:

```
php artisan ts-enums:generate --source=[default: "app/Enums"] --destination=[default: "resources/ts/enums"]
```

### Options

[](#options)

- `--source`: The directory containing the PHP enums. This option has a default value that can be set in the configuration file.
- `--destination`: The directory where the TypeScript enums will be generated. This option has a default value that can be set in the configuration file.

Customization
-------------

[](#customization)

You can customize the naming conventions for the created folders and files using the configuration file. The package will replicate the folder structure of the source directory using the provided naming conventions.

Available naming conventions are: `kebab`, `snake`, `studly`, and `camel`.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance41

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~2 days

Total

3

Last Release

489d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/042fa127461fd40068ad018c64ce7508c01b110458ccd6faa6f63c514d64456e?d=identicon)[XiDanko](/maintainers/XiDanko)

---

Top Contributors

[![XiDanko](https://avatars.githubusercontent.com/u/32465994?v=4)](https://github.com/XiDanko "XiDanko (3 commits)")

---

Tags

laravelenumtypescript

### Embed Badge

![Health badge](/badges/xidanko-ts-enums-generator/health.svg)

```
[![Health](https://phpackages.com/badges/xidanko-ts-enums-generator/health.svg)](https://phpackages.com/packages/xidanko-ts-enums-generator)
```

###  Alternatives

[simplesquid/nova-enum-field

A Laravel Nova field to add enums to resources.

52391.9k2](/packages/simplesquid-nova-enum-field)[nasyrov/laravel-enums

Laravel package for Enum implementation.

3272.5k](/packages/nasyrov-laravel-enums)[lazerg/laravel-enum-pro

A powerful PHP enum extension with collection support, random selection, and magic static calls

4319.0k](/packages/lazerg-laravel-enum-pro)[mindtwo/native-enum

Package for using native php enums.

2626.0k1](/packages/mindtwo-native-enum)[artisaninweb/laravel-enum

A provider for Enums in Laravel.

1187.5k](/packages/artisaninweb-laravel-enum)[iteks/laravel-enum

A comprehensive Laravel package providing enhanced enum functionalities, including attribute handling, select array conversions, and fluent facade interactions for robust enum management in Laravel applications.

2516.7k](/packages/iteks-laravel-enum)

PHPackages © 2026

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