Skip to content

Commit 8127833

Browse files
committed
Merge branch 'main' of github.com:SalemC/typescriptify-laravel-models
2 parents 26a235a + 8e3f1dd commit 8127833

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,26 @@
11
# typescriptify-laravel-models
2+
3+
Effortlessly generate TypeScript interface definitions from Laravel models.
4+
5+
## Example Usage
6+
7+
```php
8+
<?php
9+
10+
use SalemC\TypeScriptifyLaravelModels\TypeScriptifyModel;
11+
12+
echo TypeScriptifyModel::generate(\App\Models\User::class);
13+
```
14+
Will produce:
15+
```ts
16+
interface User {
17+
id: number;
18+
name: string;
19+
email: string;
20+
email_verified_at: string|null;
21+
password: string;
22+
remember_token: string|null;
23+
created_at: string|null;
24+
updated_at: string|null;
25+
}
26+
```

0 commit comments

Comments
 (0)