Skip to content

Commit

Permalink
chore: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
glennmichael123 committed Feb 5, 2025
1 parent 3de55fe commit 73c3eb2
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions storage/framework/core/types/src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ interface Relation<T = string> extends BaseRelation {
interface HasOne<T = string> extends Array<Relation<T>> {}
interface HasMany<T = string> extends Array<Relation<T>> {}
interface BelongsTo<T = string> extends Array<Relation<T>> {}
interface BelongsToMany<T = string> extends Array<T> {}
interface BelongsToMany<T = string> extends Array<{
model: T
firstForeignKey?: string
secondForeignKey?: string
pivotTable?: string
} | T> {}

interface HasOneThrough<T = string> extends Array<{
model: T
Expand Down Expand Up @@ -69,10 +74,10 @@ interface ActivityLogOption {
}

export interface Relations {
hasOne?: HasOne<ModelNames> | string[]
hasMany?: HasMany<ModelNames> | ModelNames[]
belongsTo?: BelongsTo<ModelNames> | ModelNames[]
belongsToMany?: BelongsToMany<ModelNames> | ModelNames[]
hasOne?: HasOne<ModelNames>
hasMany?: HasMany<ModelNames>
belongsTo?: BelongsTo<ModelNames>
belongsToMany?: BelongsToMany<ModelNames>
hasOneThrough?: HasOneThrough<ModelNames>
}

Expand Down

0 comments on commit 73c3eb2

Please sign in to comment.