Skip to content

Commit

Permalink
refactor: use wherePivot methods
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Oct 3, 2019
1 parent dfe1b28 commit 84d7928
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Orm/Relations/ManyToMany/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ export class ManyToMany implements ManyToManyRelationContract {
this._addSelect(query)
this._addJoin(query)

return query.where(`${this.pivotTable}.${this.pivotForeignKey}`, value)
return query.wherePivot(this.pivotForeignKey, value)
}

/**
Expand All @@ -248,7 +248,7 @@ export class ManyToMany implements ManyToManyRelationContract {
this._addSelect(query)
this._addJoin(query)

return query.whereIn(`${this.pivotTable}.${this.pivotForeignKey}`, values)
return query.whereInPivot(this.pivotForeignKey, values)
}

/**
Expand Down

0 comments on commit 84d7928

Please sign in to comment.