PHPackages                             benqoder/laravel-typescript-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. benqoder/laravel-typescript-generator

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

benqoder/laravel-typescript-generator
=====================================

A laravel package to generate typescript interfaces from laravel responses using GPT-3.5

1.0.2(3y ago)111[2 PRs](https://github.com/BenQoder/laravel-typescript-generator/pulls)MITPHPPHP ^8.0

Since Mar 21Pushed 2y ago1 watchersCompare

[ Source](https://github.com/BenQoder/laravel-typescript-generator)[ Packagist](https://packagist.org/packages/benqoder/laravel-typescript-generator)[ Docs](https://github.com/benqoder/laravel-typescript-generator)[ RSS](/packages/benqoder-laravel-typescript-generator/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (13)Versions (6)Used By (0)

Convert Laravel JSON Renponses to Typescript interfaces using GPT-3.5
=====================================================================

[](#convert-laravel-json-renponses-to-typescript-interfaces-using-gpt-35)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e92f755d46b60f35552652501dfe2ed630e38f097f161bca3d34fc7e35127c99/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f42656e516f6465722f6c61726176656c2d747970657363726970742d67656e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/BenQoder/laravel-typescript-gen)[![GitHub Tests Action Status](https://camo.githubusercontent.com/a47af4e1ffddf284c38658c570aaad4556c3cffe1fbd5884a41a984cd1557309/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f42656e516f6465722f6c61726176656c2d747970657363726970742d67656e2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/BenQoder/laravel-typescript-gen/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/e0472d81c409a175d5493ece0e5c5e0940639829ba57a233e95b16d6766a41ef/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f42656e516f6465722f6c61726176656c2d747970657363726970742d67656e2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/BenQoder/laravel-typescript-gen/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/705597f4b19fbc3b4c33e43c72b8b1db8e196c542c0b21aa00caec99b74d21ad/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f42656e516f6465722f6c61726176656c2d747970657363726970742d67656e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/BenQoder/laravel-typescript-gen)

This package for laravel converts your json responses to typescript types and interfaces using GPT-3.5 then stores them in the specified directory.

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

[](#installation)

You can install the package via composer:

```
composer require benqoder/laravel-typescript-generator
```

You can publish the config file with:

```
php artisan vendor:publish --tag="laravel-typescript-gen-config"
```

This is the contents of the published config file:

```
return [
    'enabled' => env('TYPESCRIPT_GENERATOR_ENABLED', false),
    'openai_api_key' => env('OPENAI_API_KEY', ''),
    'output_path' => env('TYPESCRIPT_GENERATOR_OUTPUT_PATH', '.typescript-generator'),
];
```

Usage
-----

[](#usage)

Register Typescript generator middleware as the last middleware in app/Http/Kernel.php

```
    protected $middleware = [
        ...
        \BenQoder\TypescriptGenerator\Middleware\TypescriptGenerator::class,
    ];
```

When you send request and the response header specifies content-type as "application/json" the Typesceipt interfaces will be generated and placed in "/.typescript-generator" directory or the custom direcory you specify in the config file.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

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

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Adinnu Benedict](https://github.com/BenQoder)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% 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

1196d ago

PHP version history (2 changes)v1.0.0PHP ^8.1

v1.0.1PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/733d8cf416ce960b3b8df23f27a444b37d3b7691ab9fc48fbbd9dd424eea6edc?d=identicon)[BenQoder](/maintainers/BenQoder)

---

Top Contributors

[![BenQoder](https://avatars.githubusercontent.com/u/24754078?v=4)](https://github.com/BenQoder "BenQoder (15 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")

---

Tags

laraveltypescriptgpt-3.5typescript-generatorBenQoderlaravel-typescript-generatorAI Generated Typescript Interfaces

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/benqoder-laravel-typescript-generator/health.svg)

```
[![Health](https://phpackages.com/badges/benqoder-laravel-typescript-generator/health.svg)](https://phpackages.com/packages/benqoder-laravel-typescript-generator)
```

###  Alternatives

[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329530.5k29](/packages/codewithdennis-filament-select-tree)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

124603.0k](/packages/worksome-exchange)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[tarfin-labs/event-machine

Event-driven state machines for Laravel with event sourcing, type-safe context, and full audit trail.

199.4k](/packages/tarfin-labs-event-machine)[tapp/filament-form-builder

User facing form builder using Filament components

132.4k3](/packages/tapp-filament-form-builder)

PHPackages © 2026

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