PHPackages                             danthedev/laravel-typescript-transformer-api - 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. danthedev/laravel-typescript-transformer-api

ActiveLibrary

danthedev/laravel-typescript-transformer-api
============================================

Extension of `spatie/laravel-typescript-transformer` with improvements to work with API Requests and Responses

v1.3.0(3y ago)22.8k1MITPHPPHP ^8.1

Since Dec 23Pushed 3y ago1 watchersCompare

[ Source](https://github.com/dan-the-dev/laravel-typescript-transformer-api)[ Packagist](https://packagist.org/packages/danthedev/laravel-typescript-transformer-api)[ RSS](/packages/danthedev-laravel-typescript-transformer-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (5)Used By (0)

Extension of `spatie/laravel-typescript-transformer` with improvements to work with API Requests and Responses
==============================================================================================================

[](#extension-of-spatielaravel-typescript-transformer-with-improvements-to-work-with-api-requests-and-responses)

This package is an extension of `spatie/laravel-typescript-transformer` that offers two pairs of Collector and Transformer that can be used with `spatie/laravel-typescript-transformer` via the command `php artisan typescript:transform`:

- the Request set allow you to transform all sublasses of Illuminate\\Http\\Request or Illuminate\\Foundation\\Http\\FormRequest - to achieve this, you need:
    - the RequestCollector (\\Danthedev\\LaravelTypescriptTransformerApi\\Collectors\\RequestCollector)
    - the RequestTransformer (\\Danthedev\\LaravelTypescriptTransformerApi\\Transformers\\RequestTransformer)
- the Response set allow you to transform all sublasses of Illuminate\\Http\\Response - to achieve this, you need:
    - the ResponseCollector (\\Danthedev\\LaravelTypescriptTransformerApi\\Collectors\\ResponseCollector)
    - the ResponseTransformer (\\Danthedev\\LaravelTypescriptTransformerApi\\Transformers\\ResponseTransformer)

You can install the package via composer:

```
composer require danthedev/laravel-typescript-transformer-api
```

Requirements
------------

[](#requirements)

```
* laravel 9+
* Php 8.1+
* spatie/laravel-typescript-transformer: ^2.1 [https://github.com/spatie/laravel-typescript-transformer]

```

Usage
-----

[](#usage)

Build your Api extending Request and Response Illumante classes, then automatically transform them in Typescript types.

```
```

Apply collectors and transformers to your `typescript-transformer.php` config file (we suggest you put them before `spatie/laravel-typescript-transformer` collectors and transformars - order is not important between our classes, instead).

```
// config/typescript-transformer.php

return [
    // ...
    'collectors' => [
        \Danthedev\LaravelTypescriptTransformerApi\Collectors\RequestCollector::class,
        \Danthedev\LaravelTypescriptTransformerApi\Collectors\ResponseCollector::class,

        // ...
    ],
    'transformers' => [
        \Danthedev\LaravelTypescriptTransformerApi\Transformers\RequestTransformer::class,
        \Danthedev\LaravelTypescriptTransformerApi\Transformers\ResponseTransformer::class,

        // ...
    ],
    // ...
];
```

Run command `php artisan typescript:transform` to transform to Typescript types all your Api Request and Response objects.

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.

Credits
-------

[](#credits)

- [dan-the-dev](https://github.com/dan-the-dev)

License
-------

[](#license)

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

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity57

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 ~20 days

Total

4

Last Release

1172d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/88915256dc01c61efa4900e5c763e8b8c532a81993cdf3031a0af8e7632a6aeb?d=identicon)[Dan the dev](/maintainers/Dan%20the%20dev)

---

Top Contributors

[![dan-the-dev](https://avatars.githubusercontent.com/u/22500696?v=4)](https://github.com/dan-the-dev "dan-the-dev (14 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/danthedev-laravel-typescript-transformer-api/health.svg)

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

###  Alternatives

[binaryk/laravel-restify

Laravel REST API helpers

651399.1k](/packages/binaryk-laravel-restify)[dragon-code/laravel-deploy-operations

Performing any actions during the deployment process

240173.5k2](/packages/dragon-code-laravel-deploy-operations)

PHPackages © 2026

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