Skip to content

Add filter method on ManyToMany join table. #1356

@keepcosmos

Description

@keepcosmos

Is there any way to add filter options on ManyToMany through?

like,

goodFriends: {
  relation: ManyToManyRelation,
  to: XX,
  from: YY,
  through: {
    from: 'XX.id'
    to: 'YY.id',
    filter: (builder) => { builder.where('relationships.type', 'good') }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions