Download the PHP package danthedev/laravel-typescript-transformer-api without Composer
On this page you can find all versions of the php package danthedev/laravel-typescript-transformer-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download danthedev/laravel-typescript-transformer-api
More information about danthedev/laravel-typescript-transformer-api
Files in danthedev/laravel-typescript-transformer-api
Package laravel-typescript-transformer-api
Short Description Extension of `spatie/laravel-typescript-transformer` with improvements to work with API Requests and Responses
License MIT
Informations about the package laravel-typescript-transformer-api
Extension of spatie/laravel-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:
Requirements
* laravel 9+
* Php 8.1+
* spatie/laravel-typescript-transformer: ^2.1 [https://github.com/spatie/laravel-typescript-transformer]
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).
Run command php artisan typescript:transform
to transform to Typescript types all your Api Request and Response objects.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-typescript-transformer-api with dependencies
spatie/laravel-typescript-transformer Version ^2.1
laravel/framework Version ^10.0
spatie/laravel-data Version ^2.2