niefufeng / laravel-model-typescript
There is no license information available for the latest version (0.1.0) of this package.
transform laravel models to typescript interfaces
0.1.0
2023-09-04 21:11 UTC
Requires
- php: ^8.1
- doctrine/dbal: ^3.6|^4.0
- illuminate/console: ^9.52|^10.21
- illuminate/container: ^9.52|^10.21
- illuminate/database: ^9.52|^10.21
- illuminate/pipeline: ^9.52|^10.21
- illuminate/support: ^9.52|^10.21
This package is auto-updated.
Last update: 2024-11-04 23:29:40 UTC
README
- php >= 8.1
- 如果使用注释给 getter 设置返回值,返回
Illuminate\\Database\\Eloquent\\Casts\\Attribute
类,不能简写为Attribute
- 如果使用
Illuminate\\Database\\Eloquent\\Casts\\Attribute
作为返回值,需要给get
也写上返回值,比如Attribute::get(fn(): string => 'hello')
,否则将会生成any
食用方式
# install composer require niefufeng/laravel-model-typescript --dev # publish config files php artisan vendor:publish --tag=model-typescript # generate php artisan model-typescript:generate