Methods |
public
|
has(
Relation|string $relation,
string $operator = '>=',
int $count = 1,
string $boolean = 'and',
Closure|null $callback = null,
): Builder|static
Add a relationship count / exists condition to the query.
Add a relationship count / exists condition to the query.
Throws
|
#
|
public
|
orHas(string $relation, string $operator = '>=', int $count = 1): Builder|static
Add a relationship count / exists condition to the query with an "or".
Add a relationship count / exists condition to the query with an "or".
|
#
|
public
|
doesntHave(string $relation, string $boolean = 'and', Closure|null $callback = null): Builder|static
Add a relationship count / exists condition to the query.
Add a relationship count / exists condition to the query.
|
#
|
public
|
orDoesntHave(string $relation): Builder|static
Add a relationship count / exists condition to the query with an "or".
Add a relationship count / exists condition to the query with an "or".
|
#
|
public
|
whereHas(string $relation, Closure|null $callback = null, string $operator = '>=', int $count = 1): Builder|static
Add a relationship count / exists condition to the query with where clauses.
Add a relationship count / exists condition to the query with where clauses.
|
#
|
public
|
orWhereHas(string $relation, Closure|null $callback = null, string $operator = '>=', int $count = 1): Builder|static
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 and an "or".
|
#
|
public
|
whereDoesntHave(string $relation, Closure|null $callback = null): Builder|static
Add a relationship count / exists condition to the query with where clauses.
Add a relationship count / exists condition to the query with where clauses.
|
#
|
public
|
orWhereDoesntHave(string $relation, Closure|null $callback = null): Builder|static
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 and an "or".
|
#
|
public
|
hasMorph(
MorphTo|string $relation,
string|array $types,
string $operator = '>=',
int $count = 1,
string $boolean = 'and',
Closure|null $callback = null,
): Builder|static
Add a polymorphic relationship count / exists condition to the query.
Add a polymorphic relationship count / exists condition to the query.
|
#
|
public
|
orHasMorph(MorphTo|string $relation, string|array $types, string $operator = '>=', int $count = 1): Builder|static
Add a polymorphic relationship count / exists condition to the query with an "or".
Add a polymorphic relationship count / exists condition to the query with an "or".
|
#
|
public
|
doesntHaveMorph(
MorphTo|string $relation,
string|array $types,
string $boolean = 'and',
Closure|null $callback = null,
): Builder|static
Add a polymorphic relationship count / exists condition to the query.
Add a polymorphic relationship count / exists condition to the query.
|
#
|
public
|
orDoesntHaveMorph(MorphTo|string $relation, string|array $types): Builder|static
Add a polymorphic relationship count / exists condition to the query with an "or".
Add a polymorphic relationship count / exists condition to the query with an "or".
|
#
|
public
|
whereHasMorph(
MorphTo|string $relation,
string|array $types,
Closure|null $callback = null,
string $operator = '>=',
int $count = 1,
): Builder|static
Add a polymorphic relationship count / exists condition to the query with where clauses.
Add a polymorphic relationship count / exists condition to the query with where clauses.
|
#
|
public
|
orWhereHasMorph(
MorphTo|string $relation,
string|array $types,
Closure|null $callback = null,
string $operator = '>=',
int $count = 1,
): Builder|static
Add a polymorphic relationship count / exists condition to the query with where clauses and an "or".
Add a polymorphic relationship count / exists condition to the query with where clauses and an "or".
|
#
|
public
|
whereDoesntHaveMorph(MorphTo|string $relation, string|array $types, Closure|null $callback = null): Builder|static
Add a polymorphic relationship count / exists condition to the query with where clauses.
Add a polymorphic relationship count / exists condition to the query with where clauses.
|
#
|
public
|
orWhereDoesntHaveMorph(MorphTo|string $relation, string|array $types, Closure|null $callback = null): Builder|static
Add a polymorphic relationship count / exists condition to the query with where clauses and an "or".
Add a polymorphic relationship count / exists condition to the query with where clauses and an "or".
|
#
|
public
|
whereRelation(
string $relation,
Closure|string|array|Expression $column,
mixed $operator = null,
mixed $value = null,
): Builder|static
Add a basic where clause to a relationship query.
Add a basic where clause to a relationship query.
|
#
|
public
|
orWhereRelation(
string $relation,
Closure|string|array|Expression $column,
mixed $operator = null,
mixed $value = null,
): Builder|static
Add an "or where" clause to a relationship query.
Add an "or where" clause to a relationship query.
|
#
|
public
|
whereMorphRelation(
MorphTo|string $relation,
string|array $types,
Closure|string|array|Expression $column,
mixed $operator = null,
mixed $value = null,
): Builder|static
Add a polymorphic relationship condition to the query with a where clause.
Add a polymorphic relationship condition to the query with a where clause.
|
#
|
public
|
orWhereMorphRelation(
MorphTo|string $relation,
string|array $types,
Closure|string|array|Expression $column,
mixed $operator = null,
mixed $value = null,
): Builder|static
Add a polymorphic relationship condition to the query with an "or where" clause.
Add a polymorphic relationship condition to the query with an "or where" clause.
|
#
|
public
|
whereMorphedTo(MorphTo|string $relation, Model|string $model, $boolean = 'and'): Builder|static
Add a morph-to relationship condition to the query.
Add a morph-to relationship condition to the query.
|
#
|
public
|
orWhereMorphedTo(MorphTo|string $relation, Model|string $model): Builder|static
Add a morph-to relationship condition to the query with an "or where" clause.
Add a morph-to relationship condition to the query with an "or where" clause.
|
#
|
public
|
whereBelongsTo(Model $related, $relationshipName = null, string $boolean = 'and'): $this
Add a "belongs to" relationship where clause to the query.
Add a "belongs to" relationship where clause to the query.
Throws
|
#
|
public
|
orWhereBelongsTo(Model $related, $relationshipName = null): $this
Add an "BelongsTo" relationship with an "or where" clause to the query.
Add an "BelongsTo" relationship with an "or where" clause to the query.
Throws
|
#
|
public
|
withAggregate(mixed $relations, string $column, string $function = null): $this
Add subselect queries to include an aggregate value for a relationship.
Add subselect queries to include an aggregate value for a relationship.
|
#
|
public
|
withCount(mixed $relations): $this
Add subselect queries to count the relations.
Add subselect queries to count the relations.
|
#
|
public
|
withMax(string|array $relation, string $column): $this
Add subselect queries to include the max of the relation's column.
Add subselect queries to include the max of the relation's column.
|
#
|
public
|
withMin(string|array $relation, string $column): $this
Add subselect queries to include the min of the relation's column.
Add subselect queries to include the min of the relation's column.
|
#
|
public
|
withSum(string|array $relation, string $column): $this
Add subselect queries to include the sum of the relation's column.
Add subselect queries to include the sum of the relation's column.
|
#
|
public
|
withAvg(string|array $relation, string $column): $this
Add subselect queries to include the average of the relation's column.
Add subselect queries to include the average of the relation's column.
|
#
|
public
|
withExists(string|array $relation): $this
Add subselect queries to include the existence of related models.
Add subselect queries to include the existence of related models.
|
#
|
public
|
mergeConstraintsFrom(Builder $from): Builder|static
Merge the where constraints from another query to the current query.
Merge the where constraints from another query to the current query.
|
#
|