diff --git a/storage/framework/core/types/src/model.ts b/storage/framework/core/types/src/model.ts index 20ec86826..64b6166b5 100644 --- a/storage/framework/core/types/src/model.ts +++ b/storage/framework/core/types/src/model.ts @@ -17,7 +17,12 @@ interface Relation extends BaseRelation { interface HasOne extends Array> {} interface HasMany extends Array> {} interface BelongsTo extends Array> {} -interface BelongsToMany extends Array {} +interface BelongsToMany extends Array<{ + model: T + firstForeignKey?: string + secondForeignKey?: string + pivotTable?: string +} | T> {} interface HasOneThrough extends Array<{ model: T @@ -69,10 +74,10 @@ interface ActivityLogOption { } export interface Relations { - hasOne?: HasOne | string[] - hasMany?: HasMany | ModelNames[] - belongsTo?: BelongsTo | ModelNames[] - belongsToMany?: BelongsToMany | ModelNames[] + hasOne?: HasOne + hasMany?: HasMany + belongsTo?: BelongsTo + belongsToMany?: BelongsToMany hasOneThrough?: HasOneThrough }