whereHas abstract method
QueryBuilderInterface<T>
whereHas(
- String relation, [
- void callback(
- QueryBuilderInterface query
- String operator = '>=',
- int count = 1,
Query for existence of a relationship with optional constraints Equivalent to Laravel's whereHas()
Example:
Post.query().whereHas('comments', (q) => q.where('approved', '=', true))
Implementation
QueryBuilderInterface<T> whereHas(
String relation, [
void Function(QueryBuilderInterface<dynamic> query)? callback,
String operator = '>=',
int count = 1,
]);