Skip to content

Commit 73c3eb2

Browse files
committedFeb 5, 2025·
chore: wip
1 parent 3de55fe commit 73c3eb2

File tree

1 file changed

+10
-5
lines changed
  • storage/framework/core/types/src

1 file changed

+10
-5
lines changed
 

‎storage/framework/core/types/src/model.ts

+10-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ interface Relation<T = string> extends BaseRelation {
1717
interface HasOne<T = string> extends Array<Relation<T>> {}
1818
interface HasMany<T = string> extends Array<Relation<T>> {}
1919
interface BelongsTo<T = string> extends Array<Relation<T>> {}
20-
interface BelongsToMany<T = string> extends Array<T> {}
20+
interface BelongsToMany<T = string> extends Array<{
21+
model: T
22+
firstForeignKey?: string
23+
secondForeignKey?: string
24+
pivotTable?: string
25+
} | T> {}
2126

2227
interface HasOneThrough<T = string> extends Array<{
2328
model: T
@@ -69,10 +74,10 @@ interface ActivityLogOption {
6974
}
7075

7176
export interface Relations {
72-
hasOne?: HasOne<ModelNames> | string[]
73-
hasMany?: HasMany<ModelNames> | ModelNames[]
74-
belongsTo?: BelongsTo<ModelNames> | ModelNames[]
75-
belongsToMany?: BelongsToMany<ModelNames> | ModelNames[]
77+
hasOne?: HasOne<ModelNames>
78+
hasMany?: HasMany<ModelNames>
79+
belongsTo?: BelongsTo<ModelNames>
80+
belongsToMany?: BelongsToMany<ModelNames>
7681
hasOneThrough?: HasOneThrough<ModelNames>
7782
}
7883

0 commit comments

Comments
 (0)
Please sign in to comment.