Skip to content

Commit 0520199

Browse files
committed
Merge branch 'main' of github.com:SalemC/typescriptify-laravel-models
2 parents 5d3cfd9 + 1752aeb commit 0520199

17 files changed

+8289
-68
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
/vendor/
2+
/tests/coverage/
3+
4+
.phpunit.result.cache

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function role(): BelongsTo {
6363
// app/Models/Role.php
6464
// columns: id, name
6565

66-
public function roles(): HasMany {
66+
public function users(): HasMany {
6767
return $this->hasMany(User::class);
6868
}
6969
```

composer.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,20 @@
33
"description": "Convert Laravel models into TypeScript interfaces",
44
"type": "library",
55
"license": "MIT",
6+
"scripts": {
7+
"test": "phpunit tests",
8+
"test:coverage": "phpunit tests --coverage-html ./tests/coverage"
9+
},
610
"autoload": {
711
"psr-4": {
812
"SalemC\\TypeScriptifyLaravelModels\\": "src/"
913
}
1014
},
15+
"autoload-dev": {
16+
"psr-4": {
17+
"SalemC\\TypeScriptifyLaravelModels\\Tests\\": "tests/"
18+
}
19+
},
1120
"authors": [
1221
{
1322
"name": "SalemC",
@@ -16,7 +25,12 @@
1625
],
1726
"require": {
1827
"php": ">=8.1",
19-
"doctrine/dbal": "^3.4"
28+
"doctrine/dbal": "^3.4",
29+
"laravel/framework": "^9.0"
30+
},
31+
"require-dev": {
32+
"phpunit/phpunit": "^9.5",
33+
"orchestra/testbench": "^7.10"
2034
},
2135
"extra": {
2236
"laravel": {

0 commit comments

Comments
 (0)