Download the PHP package wovosoft/laravel-typescript without Composer
On this page you can find all versions of the php package wovosoft/laravel-typescript. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wovosoft/laravel-typescript
More information about wovosoft/laravel-typescript
Files in wovosoft/laravel-typescript
Package laravel-typescript
Short Description Transforms Laravel Models to Typescript Interfaces/Types
License MIT
Homepage https://github.com/wovosoft/laravel-typescript
Informations about the package laravel-typescript
Laravel Typescript
Transforms Laravel Models to Typescript Interfaces/Types
Precautions
This packages instantiates Models to retrieve it's casts, attributes, relations in some cases. So, if your models have some sensitive actions inside __constructor method, please be aware of using this package.
Installation
Via Composer
Publish Configuration
Run the command given below. This will publish laravel-typescript.php
config file.
Configure the configurations
Usage
Run the command given below to generate typescript types.
Generated contents will be written in configured location.
Advanced Usage
Sometimes Models can be stored in different locations, like in some packages, some directories etc., in that case, please check the source of ./src/LaravelTypescript.php
You can just instantiate this class, and generate types for models in some other directories.
Note on New Model Attributes
For new Model Attributes, return type of the Closure function should be defined,
otherwise, it will generate value of
config('laravel-typescript.custom_attributes.fallback_return_type')
type for the related
property.
Change log
Please see the changelog for more information on what has changed recently.
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please create issues in Issues Tracker
Credits
- Narayan Adhikary
- All Contributors
License
MIT. Please see the license file for more information.
All versions of laravel-typescript with dependencies
laravel/framework Version ^11.0
composer/class-map-generator Version >=1.1.0