QueriesRelationships
trait QueriesRelationships
Methods
Add a relationship count / exists condition to the query with an "or".
Add a relationship count / exists condition to the query.
Add a relationship count / exists condition to the query with an "or".
Add a relationship count / exists condition to the query with where clauses and an "or".
Add a relationship count / exists condition to the query with where clauses.
Add a relationship count / exists condition to the query with where clauses and an "or".
Add subselect queries to count the relations.
Add the "has" condition where clause to the query.
Merge the where constraints from another query to the current query.
Add a sub-query count clause to this query.
Get the "has relation" base query instance.
Check if we can run an "exists" query to optimize performance.
Details
at line 25
Builder|QueriesRelationships
has(string $relation, string $operator = '>=', int $count = 1, string $boolean = 'and', Closure $callback = null)
Add a relationship count / exists condition to the query.
at line 68
protected Builder|QueriesRelationships
hasNested(string $relations, string $operator = '>=', int $count = 1, string $boolean = 'and', Closure|null $callback = null)
Add nested relationship count / exists conditions to the query.
Sets up recursive call to whereHas until we finish the nested relation.
at line 92
Builder|QueriesRelationships
orHas(string $relation, string $operator = '>=', int $count = 1)
Add a relationship count / exists condition to the query with an "or".
at line 105
Builder|QueriesRelationships
doesntHave(string $relation, string $boolean = 'and', Closure $callback = null)
Add a relationship count / exists condition to the query.
at line 116
Builder|QueriesRelationships
orDoesntHave(string $relation)
Add a relationship count / exists condition to the query with an "or".
at line 130
Builder|QueriesRelationships
whereHas(string $relation, Closure $callback = null, string $operator = '>=', int $count = 1)
Add a relationship count / exists condition to the query with where clauses.
at line 144
Builder|QueriesRelationships
orWhereHas(string $relation, Closure $callback = null, string $operator = '>=', int $count = 1)
Add a relationship count / exists condition to the query with where clauses and an "or".
at line 156
Builder|QueriesRelationships
whereDoesntHave(string $relation, Closure $callback = null)
Add a relationship count / exists condition to the query with where clauses.
at line 168
Builder|QueriesRelationships
orWhereDoesntHave(string $relation, Closure $callback = null)
Add a relationship count / exists condition to the query with where clauses and an "or".
at line 179
$this
withCount(mixed $relations)
Add subselect queries to count the relations.
at line 237
protected Builder|QueriesRelationships
addHasWhere(Builder $hasQuery, Relation $relation, string $operator, int $count, string $boolean)
Add the "has" condition where clause to the query.
at line 252
Builder|QueriesRelationships
mergeConstraintsFrom(Builder $from)
Merge the where constraints from another query to the current query.
at line 277
protected $this
addWhereCountQuery(Builder $query, string $operator = '>=', int $count = 1, string $boolean = 'and')
Add a sub-query count clause to this query.
at line 295
protected Relation
getRelationWithoutConstraints(string $relation)
Get the "has relation" base query instance.
at line 309
protected bool
canUseExistsForExistenceCheck(string $operator, int $count)
Check if we can run an "exists" query to optimize performance.