QueriesRelationships (Database\Eloquent\Concerns)

QueriesRelationships

trait QueriesRelationships (View source)

Methods

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.

Builder|QueriesRelationships orHas(string $relation, string $operator = '>=', int $count = 1)

Add a relationship count / exists condition to the query with an "or".

Builder|QueriesRelationships doesntHave(string $relation, string $boolean = 'and', Closure $callback = null)

Add a relationship count / exists condition to the query.

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.

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".

Builder|QueriesRelationships whereDoesntHave(string $relation, Closure $callback = null)

Add a relationship count / exists condition to the query with where clauses.

$this withCount(mixed $relations)

Add subselect queries to count the relations.

Builder|QueriesRelationships mergeConstraintsFrom(Builder $from)

Merge the where constraints from another query to the current query.

Details

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.

Parameters

string $relation
string $operator
int $count
string $boolean
Closure $callback

Return Value

Builder|QueriesRelationships

Builder|QueriesRelationships orHas(string $relation, string $operator = '>=', int $count = 1)

Add a relationship count / exists condition to the query with an "or".

Parameters

string $relation
string $operator
int $count

Return Value

Builder|QueriesRelationships

Builder|QueriesRelationships doesntHave(string $relation, string $boolean = 'and', Closure $callback = null)

Add a relationship count / exists condition to the query.

Parameters

string $relation
string $boolean
Closure $callback

Return Value

Builder|QueriesRelationships

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.

Parameters

string $relation
Closure $callback
string $operator
int $count

Return Value

Builder|QueriesRelationships

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".

Parameters

string $relation
Closure $callback
string $operator
int $count

Return Value

Builder|QueriesRelationships

Builder|QueriesRelationships whereDoesntHave(string $relation, Closure $callback = null)

Add a relationship count / exists condition to the query with where clauses.

Parameters

string $relation
Closure $callback

Return Value

Builder|QueriesRelationships

$this withCount(mixed $relations)

Add subselect queries to count the relations.

Parameters

mixed $relations

Return Value

$this

Builder|QueriesRelationships mergeConstraintsFrom(Builder $from)

Merge the where constraints from another query to the current query.

Parameters

Builder $from

Return Value

Builder|QueriesRelationships

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.4/Illuminate/Database/Eloquent/Concerns/QueriesRelationships.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部