withWhereHas method

ModelQuery<T> withWhereHas(
  1. String relation, [
  2. RelationConstraint? constraint
])

whereHas + with with the same constraint.

Implementation

ModelQuery<T> withWhereHas(
  String relation, [
  RelationConstraint? constraint,
]) {
  whereHas(relation, constraint);
  _with[relation] = constraint;
  return this;
}