PHP Класс Eloquent, someline-starter

User: qixieyu Date: 15-7-3 Time: 下午8:41
Наследование: extends Db
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
addBinding ( mixed $value, string $type = 'where' ) Add a binding to the query.
addNestedWhereQuery ( Builder | static $query, string $boolean = 'and' ) Add another query builder as a nested where to the query builder.
addSelect ( array | mixed $column ) Add a new select column to the query.
addWhereExistsQuery ( Builder $query, string $boolean = 'and', boolean $not = false ) Add an exists clause to the query.
aggregate ( string $function, array $columns = [] ) : float | integer Execute an aggregate function on the database.
applyScopes ( ) : Builder | static Apply the scopes to the Eloquent builder instance and return it.
average ( string $column ) : float | integer Alias for the "avg" method.
avg ( string $column ) : float | integer Retrieve the average of the values of a given column.
chunk ( integer $count, callable $callback ) : boolean Chunk the results of the query.
chunkById ( integer $count, callable $callback, string $column = 'id' ) : boolean Chunk the results of a query by comparing numeric IDs.
count ( string $columns = '*' ) : integer Retrieve the "count" result of the query.
crossJoin ( string $table, string $first = null, string $operator = null, string $second = null ) : Builder | static Add a "cross join" clause to the query.
cursor ( ) : Generator Get a generator for the given query.
distinct ( ) Force the query to only return distinct results.
doesntHave ( string $relation, string $boolean = 'and', Closure | null $callback = null ) : Builder | static Add a relationship count / exists condition to the query.
dynamicWhere ( string $method, string $parameters ) Handles dynamic "where" clauses to the query.
each ( callable $callback, integer $count = 1000 ) : boolean Execute a callback over each item while chunking.
eagerLoadRelations ( array $models ) : array Eager load the relationships for the models.
exists ( ) : boolean Determine if any rows exist for the current query.
find ( mixed $id, array $columns = [] ) : Model | Illuminate\Database\Eloquent\Collection | static[] | static | null Find a model by its primary key.
findMany ( array $ids, array $columns = [] ) : Illuminate\Database\Eloquent\Collection Find multiple models by their primary keys.
findOrFail ( mixed $id, array $columns = [] ) : Model | Illuminate\Database\Eloquent\Collection Find a model by its primary key or throw an exception.
findOrNew ( mixed $id, array $columns = [] ) : Model Find a model by its primary key or return fresh model instance.
first ( array $columns = [] ) : Model | static | null Execute the query and get the first result.
firstOrCreate ( array $attributes ) : Model Get the first record matching the attributes or create it.
firstOrFail ( array $columns = [] ) : Model | static Execute the query and get the first result or throw an exception.
firstOrNew ( array $attributes ) : Model Get the first record matching the attributes or instantiate it.
forNestedWhere ( ) : Builder Create a new query instance for nested where condition.
forPage ( integer $page, integer $perPage = 15 ) : Builder | static Set the limit and offset for a given page.
forPageAfterId ( integer $perPage = 15, integer $lastId, string $column = 'id' ) : Builder | static Constrain the query to the next "page" of results after a given ID.
from ( string $table ) Set the table which the query is targeting.
get ( array $columns = [] ) : Illuminate\Database\Eloquent\Collection | static[] Execute the query as a "select" statement.
getBindings ( ) : array Get the current query value bindings in a flattened array.
getCountForPagination ( array $columns = [] ) : integer Get the count of the total records for the paginator.
getEagerLoads ( ) : array Get the relationships being eagerly loaded.
getGrammar ( ) : Illuminate\Database\Query\Grammars\Grammar Get the query grammar instance.
getMacro ( string $name ) : Closure Get the given macro by name.
getModel ( ) : Model Get the model instance being queried.
getModels ( array $columns = [] ) : Model[] Get the hydrated models without eager loading.
getProcessor ( ) : Illuminate\Database\Query\Processors\Processor Get the database query processor instance.
getQuery ( ) : Builder Get the underlying query builder instance.
getRawBindings ( ) : array Get the raw array of bindings.
groupBy ( ) Add a "group by" clause to the query.
has ( string $relation, string $operator = '>=', integer $count = 1, string $boolean = 'and', Closure | null $callback = null ) : Builder | static Add a relationship count / exists condition to the query.
hasMacro ( string $name ) : boolean Checks if macro is registered.
having ( string $column, string $operator = null, string $value = null, string $boolean = 'and' ) Add a "having" clause to the query.
havingRaw ( string $sql, array $bindings = [], string $boolean = 'and' ) Add a raw having clause to the query.
implode ( string $column, string $glue = '' ) : string Concatenate values of a given column as a string.
inRandomOrder ( string $seed = '' ) Put the query's results in random order.
insert ( array $values ) : boolean Insert a new record into the database.
insertGetId ( array $values, string $sequence = null ) : integer Insert a new record and get the value of the primary key.
join ( string $table, string $one, string $operator = null, string $two = null, string $type = 'inner', boolean $where = false ) Add a join clause to the query.
joinWhere ( string $table, string $one, string $operator, string $two, string $type = 'inner' ) : Builder | static Add a "join where" clause to the query.
latest ( string $column = 'created_at' ) : Builder | static Add an "order by" clause for a timestamp to the query.
leftJoin ( string $table, string $first, string $operator = null, string $second = null ) : Builder | static Add a left join to the query.
leftJoinWhere ( string $table, string $one, string $operator, string $two ) : Builder | static Add a "join where" clause to the query.
limit ( integer $value ) Set the "limit" value of the query.
lists ( string $column, string $key = null ) : Collection Alias for the "pluck" method.
lock ( boolean $value = true ) Lock the selected rows in the table.
lockForUpdate ( ) : Builder Lock the selected rows in the table for updating.
macro ( string $name, Closure $callback ) : void Extend the builder with a given callback.
macroCall ( string $method, array $parameters ) : mixed Dynamically handle calls to the class.
max ( string $column ) : float | integer Retrieve the maximum value of a given column.
mergeBindings ( Builder $query ) Merge an array of bindings into our bindings.
mergeModelDefinedRelationConstraints ( Builder $relation ) : Builder | static Merge the constraints from a relation query to the current query.
mergeWheres ( array $wheres, array $bindings ) : void Merge an array of where clauses and bindings.
min ( string $column ) : float | integer Retrieve the minimum value of a given column.
offset ( integer $value ) Set the "offset" value of the query.
oldest ( string $column = 'created_at' ) : Builder | static Add an "order by" clause for a timestamp to the query.
onDelete ( Closure $callback ) : void Register a replacement for the default delete function.
orHas ( string $relation, string $operator = '>=', integer $count = 1 ) : Builder | static Add a relationship count / exists condition to the query with an "or".
orHaving ( string $column, string $operator = null, string $value = null ) : Builder | static Add a "or having" clause to the query.
orHavingRaw ( string $sql, array $bindings = [] ) : Builder | static Add a raw or having clause to the query.
orWhere ( string $column, string $operator = null, mixed $value = null ) : Builder | static Add an "or where" clause to the query.
orWhereBetween ( string $column, array $values ) : Builder | static Add an or where between statement to the query.
orWhereColumn ( string | array $first, string | null $operator = null, string | null $second = null ) : Builder | static Add an "or where" clause comparing two columns to the query.
orWhereDate ( string $column, string $operator, integer $value ) : Builder | static Add an "or where date" statement to the query.
orWhereExists ( Closure $callback, boolean $not = false ) : Builder | static Add an or exists clause to the query.
orWhereHas ( string $relation, Closure $callback, string $operator = '>=', integer $count = 1 ) : Builder | static Add a relationship count / exists condition to the query with where clauses and an "or".
orWhereIn ( string $column, mixed $values ) : Builder | static Add an "or where in" clause to the query.
orWhereNotBetween ( string $column, array $values ) : Builder | static Add an or where not between statement to the query.
orWhereNotExists ( Closure $callback ) : Builder | static Add a where not exists clause to the query.
orWhereNotIn ( string $column, mixed $values ) : Builder | static Add an "or where not in" clause to the query.
orWhereNotNull ( string $column ) : Builder | static Add an "or where not null" clause to the query.
orWhereNull ( string $column ) : Builder | static Add an "or where null" clause to the query.
orWhereRaw ( string $sql, array $bindings = [] ) : Builder | static Add a raw or where clause to the query.
orWhereTime ( string $column, string $operator, integer $value ) : Builder | static Add an "or where time" statement to the query.
orderBy ( string $column, string $direction = 'asc' ) Add an "order by" clause to the query.
orderByRaw ( string $sql, array $bindings = [] ) Add a raw "order by" clause to the query.
paginate ( integer $perPage = null, array $columns = [], string $pageName = 'page', integer | null $page = null ) : Illuminate\Contracts\Pagination\LengthAwarePaginator Paginate the given query.
pluck ( string $column, string | null $key = null ) : Collection Get an array with the values of a given column.
raw ( mixed $value ) : Illuminate\Database\Query\Expression Create a raw database expression.
removedScopes ( ) : array Get an array of global scopes that were removed from the query.
rightJoin ( string $table, string $first, string $operator = null, string $second = null ) : Builder | static Add a right join to the query.
rightJoinWhere ( string $table, string $one, string $operator, string $two ) : Builder | static Add a "right join where" clause to the query.
scopes ( array $scopes ) : mixed Add the given scopes to the current builder instance.
select ( array | mixed $columns = [] ) Set the columns to be selected.
selectRaw ( string $expression, array $bindings = [] ) : Builder | static Add a new "raw" select expression to the query.
selectSub ( Closure | Builder | string $query, string $as ) : Builder | static Add a subselect expression to the query.
setBindings ( array $bindings, string $type = 'where' ) Set the bindings on the query builder.
setEagerLoads ( array $eagerLoad ) Set the relationships being eagerly loaded.
setModel ( Model $model ) Set a model instance for the model being queried.
setQuery ( Builder $query ) Set the underlying query builder instance.
sharedLock ( ) : Builder Share lock the selected rows in the table.
simplePaginate ( integer $perPage = null, array $columns = [], string $pageName = 'page', integer | null $page = null ) : Illuminate\Contracts\Pagination\Paginator Paginate the given query into a simple paginator.
skip ( integer $value ) : Builder | static Alias to set the "offset" value of the query.
sum ( string $column ) : float | integer Retrieve the sum of the values of a given column.
take ( integer $value ) : Builder | static Alias to set the "limit" value of the query.
toBase ( ) : Builder Get a base query builder instance.
toSql ( ) : string Get the SQL representation of the query.
truncate ( ) : void Run a truncate statement on the table.
union ( Builder | Closure $query, boolean $all = false ) : Builder | static Add a union statement to the query.
unionAll ( Builder | Closure $query ) : Builder | static Add a union all statement to the query.
updateOrCreate ( array $attributes, array $values = [] ) : Model Create or update a record matching the attributes, and fill it with values.
updateOrInsert ( array $attributes, array $values = [] ) : boolean Insert or update a record matching the attributes, and fill it with values.
useWritePdo ( ) Use the write pdo for query.
value ( string $column ) : mixed Get a single column's value from the first result of a query.
when ( boolean $value, Closure $callback ) Apply the callback's query changes if the given "value" is true.
where ( string $column, string $operator = null, mixed $value = null, string $boolean = 'and' ) Add a basic where clause to the query.
whereBetween ( string $column, array $values, string $boolean = 'and', boolean $not = false ) Add a where between statement to the query.
whereColumn ( string | array $first, string | null $operator = null, string | null $second = null, string | null $boolean = 'and' ) : Builder | static Add a "where" clause comparing two columns to the query.
whereDate ( string $column, string $operator, integer $value, string $boolean = 'and' ) : Builder | static Add a "where date" statement to the query.
whereDay ( string $column, string $operator, integer $value, string $boolean = 'and' ) : Builder | static Add a "where day" statement to the query.
whereDoesntHave ( string $relation, Closure | null $callback = null ) : Builder | static Add a relationship count / exists condition to the query with where clauses.
whereExists ( Closure $callback, string $boolean = 'and', boolean $not = false ) Add an exists clause to the query.
whereHas ( string $relation, Closure $callback, string $operator = '>=', integer $count = 1 ) : Builder | static Add a relationship count / exists condition to the query with where clauses.
whereIn ( string $column, mixed $values, string $boolean = 'and', boolean $not = false ) Add a "where in" clause to the query.
whereMonth ( string $column, string $operator, integer $value, string $boolean = 'and' ) : Builder | static Add a "where month" statement to the query.
whereNested ( Closure $callback, string $boolean = 'and' ) : Builder | static Add a nested where statement to the query.
whereNotBetween ( string $column, array $values, string $boolean = 'and' ) : Builder | static Add a where not between statement to the query.
whereNotExists ( Closure $callback, string $boolean = 'and' ) : Builder | static Add a where not exists clause to the query.
whereNotIn ( string $column, mixed $values, string $boolean = 'and' ) : Builder | static Add a "where not in" clause to the query.
whereNotNull ( string $column, string $boolean = 'and' ) : Builder | static Add a "where not null" clause to the query.
whereNull ( string $column, string $boolean = 'and', boolean $not = false ) Add a "where null" clause to the query.
whereRaw ( string $sql, array $bindings = [], string $boolean = 'and' ) Add a raw where clause to the query.
whereTime ( string $column, string $operator, integer $value, string $boolean = 'and' ) : Builder | static Add a "where time" statement to the query.
whereYear ( string $column, string $operator, integer $value, string $boolean = 'and' ) : Builder | static Add a "where year" statement to the query.
withCount ( mixed $relations ) Add subselect queries to count the relations.
withGlobalScope ( string $identifier, Illuminate\Database\Eloquent\Scope | Closure $scope ) Register a new global scope.
without ( mixed $relations ) Prevent the specified relations from being eager loaded.
withoutGlobalScope ( Illuminate\Database\Eloquent\Scope | string $scope ) Remove a registered global scope.
withoutGlobalScopes ( array | null $scopes = null ) Remove all or passed registered global scopes.

Описание методов

addBinding() публичный статический Метод

Add a binding to the query.
public static addBinding ( mixed $value, string $type = 'where' )
$value mixed
$type string

addNestedWhereQuery() публичный статический Метод

Add another query builder as a nested where to the query builder.
public static addNestedWhereQuery ( Builder | static $query, string $boolean = 'and' )
$query Illuminate\Database\Query\Builder | static
$boolean string

addSelect() публичный статический Метод

Add a new select column to the query.
public static addSelect ( array | mixed $column )
$column array | mixed

addWhereExistsQuery() публичный статический Метод

Add an exists clause to the query.
public static addWhereExistsQuery ( Builder $query, string $boolean = 'and', boolean $not = false )
$query Illuminate\Database\Query\Builder
$boolean string
$not boolean

aggregate() публичный статический Метод

Execute an aggregate function on the database.
public static aggregate ( string $function, array $columns = [] ) : float | integer
$function string
$columns array
Результат float | integer

applyScopes() публичный статический Метод

Apply the scopes to the Eloquent builder instance and return it.
public static applyScopes ( ) : Builder | static
Результат Illuminate\Database\Eloquent\Builder | static

average() публичный статический Метод

Alias for the "avg" method.
public static average ( string $column ) : float | integer
$column string
Результат float | integer

avg() публичный статический Метод

Retrieve the average of the values of a given column.
public static avg ( string $column ) : float | integer
$column string
Результат float | integer

chunk() публичный статический Метод

Chunk the results of the query.
public static chunk ( integer $count, callable $callback ) : boolean
$count integer
$callback callable
Результат boolean

chunkById() публичный статический Метод

Chunk the results of a query by comparing numeric IDs.
public static chunkById ( integer $count, callable $callback, string $column = 'id' ) : boolean
$count integer
$callback callable
$column string
Результат boolean

count() публичный статический Метод

Retrieve the "count" result of the query.
public static count ( string $columns = '*' ) : integer
$columns string
Результат integer

crossJoin() публичный статический Метод

Add a "cross join" clause to the query.
public static crossJoin ( string $table, string $first = null, string $operator = null, string $second = null ) : Builder | static
$table string
$first string
$operator string
$second string
Результат Illuminate\Database\Query\Builder | static

cursor() публичный статический Метод

Get a generator for the given query.
public static cursor ( ) : Generator
Результат Generator

distinct() публичный статический Метод

Force the query to only return distinct results.
public static distinct ( )

doesntHave() публичный статический Метод

Add a relationship count / exists condition to the query.
public static doesntHave ( string $relation, string $boolean = 'and', Closure | null $callback = null ) : Builder | static
$relation string
$boolean string
$callback Closure | null
Результат Illuminate\Database\Eloquent\Builder | static

dynamicWhere() публичный статический Метод

Handles dynamic "where" clauses to the query.
public static dynamicWhere ( string $method, string $parameters )
$method string
$parameters string

each() публичный статический Метод

Execute a callback over each item while chunking.
public static each ( callable $callback, integer $count = 1000 ) : boolean
$callback callable
$count integer
Результат boolean

eagerLoadRelations() публичный статический Метод

Eager load the relationships for the models.
public static eagerLoadRelations ( array $models ) : array
$models array
Результат array

exists() публичный статический Метод

Determine if any rows exist for the current query.
public static exists ( ) : boolean
Результат boolean

find() публичный статический Метод

Find a model by its primary key.
public static find ( mixed $id, array $columns = [] ) : Model | Illuminate\Database\Eloquent\Collection | static[] | static | null
$id mixed
$columns array
Результат Illuminate\Database\Eloquent\Model | Illuminate\Database\Eloquent\Collection | static[] | static | null

findMany() публичный статический Метод

Find multiple models by their primary keys.
public static findMany ( array $ids, array $columns = [] ) : Illuminate\Database\Eloquent\Collection
$ids array
$columns array
Результат Illuminate\Database\Eloquent\Collection

findOrFail() публичный статический Метод

Find a model by its primary key or throw an exception.
public static findOrFail ( mixed $id, array $columns = [] ) : Model | Illuminate\Database\Eloquent\Collection
$id mixed
$columns array
Результат Illuminate\Database\Eloquent\Model | Illuminate\Database\Eloquent\Collection

findOrNew() публичный статический Метод

Find a model by its primary key or return fresh model instance.
public static findOrNew ( mixed $id, array $columns = [] ) : Model
$id mixed
$columns array
Результат Illuminate\Database\Eloquent\Model

first() публичный статический Метод

Execute the query and get the first result.
public static first ( array $columns = [] ) : Model | static | null
$columns array
Результат Illuminate\Database\Eloquent\Model | static | null

firstOrCreate() публичный статический Метод

Get the first record matching the attributes or create it.
public static firstOrCreate ( array $attributes ) : Model
$attributes array
Результат Illuminate\Database\Eloquent\Model

firstOrFail() публичный статический Метод

Execute the query and get the first result or throw an exception.
public static firstOrFail ( array $columns = [] ) : Model | static
$columns array
Результат Illuminate\Database\Eloquent\Model | static

firstOrNew() публичный статический Метод

Get the first record matching the attributes or instantiate it.
public static firstOrNew ( array $attributes ) : Model
$attributes array
Результат Illuminate\Database\Eloquent\Model

forNestedWhere() публичный статический Метод

Create a new query instance for nested where condition.
public static forNestedWhere ( ) : Builder
Результат Illuminate\Database\Query\Builder

forPage() публичный статический Метод

Set the limit and offset for a given page.
public static forPage ( integer $page, integer $perPage = 15 ) : Builder | static
$page integer
$perPage integer
Результат Illuminate\Database\Query\Builder | static

forPageAfterId() публичный статический Метод

Constrain the query to the next "page" of results after a given ID.
public static forPageAfterId ( integer $perPage = 15, integer $lastId, string $column = 'id' ) : Builder | static
$perPage integer
$lastId integer
$column string
Результат Illuminate\Database\Query\Builder | static

from() публичный статический Метод

Set the table which the query is targeting.
public static from ( string $table )
$table string

get() публичный статический Метод

Execute the query as a "select" statement.
public static get ( array $columns = [] ) : Illuminate\Database\Eloquent\Collection | static[]
$columns array
Результат Illuminate\Database\Eloquent\Collection | static[]

getBindings() публичный статический Метод

Get the current query value bindings in a flattened array.
public static getBindings ( ) : array
Результат array

getCountForPagination() публичный статический Метод

Get the count of the total records for the paginator.
public static getCountForPagination ( array $columns = [] ) : integer
$columns array
Результат integer

getEagerLoads() публичный статический Метод

Get the relationships being eagerly loaded.
public static getEagerLoads ( ) : array
Результат array

getGrammar() публичный статический Метод

Get the query grammar instance.
public static getGrammar ( ) : Illuminate\Database\Query\Grammars\Grammar
Результат Illuminate\Database\Query\Grammars\Grammar

getMacro() публичный статический Метод

Get the given macro by name.
public static getMacro ( string $name ) : Closure
$name string
Результат Closure

getModel() публичный статический Метод

Get the model instance being queried.
public static getModel ( ) : Model
Результат Illuminate\Database\Eloquent\Model

getModels() публичный статический Метод

Get the hydrated models without eager loading.
public static getModels ( array $columns = [] ) : Model[]
$columns array
Результат Illuminate\Database\Eloquent\Model[]

getProcessor() публичный статический Метод

Get the database query processor instance.
public static getProcessor ( ) : Illuminate\Database\Query\Processors\Processor
Результат Illuminate\Database\Query\Processors\Processor

getQuery() публичный статический Метод

Get the underlying query builder instance.
public static getQuery ( ) : Builder
Результат Illuminate\Database\Query\Builder

getRawBindings() публичный статический Метод

Get the raw array of bindings.
public static getRawBindings ( ) : array
Результат array

groupBy() публичный статический Метод

Add a "group by" clause to the query.
public static groupBy ( )

has() публичный статический Метод

Add a relationship count / exists condition to the query.
public static has ( string $relation, string $operator = '>=', integer $count = 1, string $boolean = 'and', Closure | null $callback = null ) : Builder | static
$relation string
$operator string
$count integer
$boolean string
$callback Closure | null
Результат Illuminate\Database\Eloquent\Builder | static

hasMacro() публичный статический Метод

Checks if macro is registered.
public static hasMacro ( string $name ) : boolean
$name string
Результат boolean

having() публичный статический Метод

Add a "having" clause to the query.
public static having ( string $column, string $operator = null, string $value = null, string $boolean = 'and' )
$column string
$operator string
$value string
$boolean string

havingRaw() публичный статический Метод

Add a raw having clause to the query.
public static havingRaw ( string $sql, array $bindings = [], string $boolean = 'and' )
$sql string
$bindings array
$boolean string

implode() публичный статический Метод

Concatenate values of a given column as a string.
public static implode ( string $column, string $glue = '' ) : string
$column string
$glue string
Результат string

inRandomOrder() публичный статический Метод

Put the query's results in random order.
public static inRandomOrder ( string $seed = '' )
$seed string

insert() публичный статический Метод

Insert a new record into the database.
public static insert ( array $values ) : boolean
$values array
Результат boolean

insertGetId() публичный статический Метод

Insert a new record and get the value of the primary key.
public static insertGetId ( array $values, string $sequence = null ) : integer
$values array
$sequence string
Результат integer

join() публичный статический Метод

Add a join clause to the query.
public static join ( string $table, string $one, string $operator = null, string $two = null, string $type = 'inner', boolean $where = false )
$table string
$one string
$operator string
$two string
$type string
$where boolean

joinWhere() публичный статический Метод

Add a "join where" clause to the query.
public static joinWhere ( string $table, string $one, string $operator, string $two, string $type = 'inner' ) : Builder | static
$table string
$one string
$operator string
$two string
$type string
Результат Illuminate\Database\Query\Builder | static

latest() публичный статический Метод

Add an "order by" clause for a timestamp to the query.
public static latest ( string $column = 'created_at' ) : Builder | static
$column string
Результат Illuminate\Database\Query\Builder | static

leftJoin() публичный статический Метод

Add a left join to the query.
public static leftJoin ( string $table, string $first, string $operator = null, string $second = null ) : Builder | static
$table string
$first string
$operator string
$second string
Результат Illuminate\Database\Query\Builder | static

leftJoinWhere() публичный статический Метод

Add a "join where" clause to the query.
public static leftJoinWhere ( string $table, string $one, string $operator, string $two ) : Builder | static
$table string
$one string
$operator string
$two string
Результат Illuminate\Database\Query\Builder | static

limit() публичный статический Метод

Set the "limit" value of the query.
public static limit ( integer $value )
$value integer

lists() публичный статический Метод

Alias for the "pluck" method.
Устаревший: since version 5.2. Use the "pluck" method directly.
public static lists ( string $column, string $key = null ) : Collection
$column string
$key string
Результат Illuminate\Support\Collection

lock() публичный статический Метод

Lock the selected rows in the table.
public static lock ( boolean $value = true )
$value boolean

lockForUpdate() публичный статический Метод

Lock the selected rows in the table for updating.
public static lockForUpdate ( ) : Builder
Результат Illuminate\Database\Query\Builder

macro() публичный статический Метод

Extend the builder with a given callback.
public static macro ( string $name, Closure $callback ) : void
$name string
$callback Closure
Результат void

macroCall() публичный статический Метод

Dynamically handle calls to the class.
public static macroCall ( string $method, array $parameters ) : mixed
$method string
$parameters array
Результат mixed

max() публичный статический Метод

Retrieve the maximum value of a given column.
public static max ( string $column ) : float | integer
$column string
Результат float | integer

mergeBindings() публичный статический Метод

Merge an array of bindings into our bindings.
public static mergeBindings ( Builder $query )
$query Illuminate\Database\Query\Builder

mergeModelDefinedRelationConstraints() публичный статический Метод

Merge the constraints from a relation query to the current query.
public static mergeModelDefinedRelationConstraints ( Builder $relation ) : Builder | static
$relation Illuminate\Database\Eloquent\Builder
Результат Illuminate\Database\Eloquent\Builder | static

mergeWheres() публичный статический Метод

Merge an array of where clauses and bindings.
public static mergeWheres ( array $wheres, array $bindings ) : void
$wheres array
$bindings array
Результат void

min() публичный статический Метод

Retrieve the minimum value of a given column.
public static min ( string $column ) : float | integer
$column string
Результат float | integer

offset() публичный статический Метод

Set the "offset" value of the query.
public static offset ( integer $value )
$value integer

oldest() публичный статический Метод

Add an "order by" clause for a timestamp to the query.
public static oldest ( string $column = 'created_at' ) : Builder | static
$column string
Результат Illuminate\Database\Query\Builder | static

onDelete() публичный статический Метод

Register a replacement for the default delete function.
public static onDelete ( Closure $callback ) : void
$callback Closure
Результат void

orHas() публичный статический Метод

Add a relationship count / exists condition to the query with an "or".
public static orHas ( string $relation, string $operator = '>=', integer $count = 1 ) : Builder | static
$relation string
$operator string
$count integer
Результат Illuminate\Database\Eloquent\Builder | static

orHaving() публичный статический Метод

Add a "or having" clause to the query.
public static orHaving ( string $column, string $operator = null, string $value = null ) : Builder | static
$column string
$operator string
$value string
Результат Illuminate\Database\Query\Builder | static

orHavingRaw() публичный статический Метод

Add a raw or having clause to the query.
public static orHavingRaw ( string $sql, array $bindings = [] ) : Builder | static
$sql string
$bindings array
Результат Illuminate\Database\Query\Builder | static

orWhere() публичный статический Метод

Add an "or where" clause to the query.
public static orWhere ( string $column, string $operator = null, mixed $value = null ) : Builder | static
$column string
$operator string
$value mixed
Результат Illuminate\Database\Eloquent\Builder | static

orWhereBetween() публичный статический Метод

Add an or where between statement to the query.
public static orWhereBetween ( string $column, array $values ) : Builder | static
$column string
$values array
Результат Illuminate\Database\Query\Builder | static

orWhereColumn() публичный статический Метод

Add an "or where" clause comparing two columns to the query.
public static orWhereColumn ( string | array $first, string | null $operator = null, string | null $second = null ) : Builder | static
$first string | array
$operator string | null
$second string | null
Результат Illuminate\Database\Query\Builder | static

orWhereDate() публичный статический Метод

Add an "or where date" statement to the query.
public static orWhereDate ( string $column, string $operator, integer $value ) : Builder | static
$column string
$operator string
$value integer
Результат Illuminate\Database\Query\Builder | static

orWhereExists() публичный статический Метод

Add an or exists clause to the query.
public static orWhereExists ( Closure $callback, boolean $not = false ) : Builder | static
$callback Closure
$not boolean
Результат Illuminate\Database\Query\Builder | static

orWhereHas() публичный статический Метод

Add a relationship count / exists condition to the query with where clauses and an "or".
public static orWhereHas ( string $relation, Closure $callback, string $operator = '>=', integer $count = 1 ) : Builder | static
$relation string
$callback Closure
$operator string
$count integer
Результат Illuminate\Database\Eloquent\Builder | static

orWhereIn() публичный статический Метод

Add an "or where in" clause to the query.
public static orWhereIn ( string $column, mixed $values ) : Builder | static
$column string
$values mixed
Результат Illuminate\Database\Query\Builder | static

orWhereNotBetween() публичный статический Метод

Add an or where not between statement to the query.
public static orWhereNotBetween ( string $column, array $values ) : Builder | static
$column string
$values array
Результат Illuminate\Database\Query\Builder | static

orWhereNotExists() публичный статический Метод

Add a where not exists clause to the query.
public static orWhereNotExists ( Closure $callback ) : Builder | static
$callback Closure
Результат Illuminate\Database\Query\Builder | static

orWhereNotIn() публичный статический Метод

Add an "or where not in" clause to the query.
public static orWhereNotIn ( string $column, mixed $values ) : Builder | static
$column string
$values mixed
Результат Illuminate\Database\Query\Builder | static

orWhereNotNull() публичный статический Метод

Add an "or where not null" clause to the query.
public static orWhereNotNull ( string $column ) : Builder | static
$column string
Результат Illuminate\Database\Query\Builder | static

orWhereNull() публичный статический Метод

Add an "or where null" clause to the query.
public static orWhereNull ( string $column ) : Builder | static
$column string
Результат Illuminate\Database\Query\Builder | static

orWhereRaw() публичный статический Метод

Add a raw or where clause to the query.
public static orWhereRaw ( string $sql, array $bindings = [] ) : Builder | static
$sql string
$bindings array
Результат Illuminate\Database\Query\Builder | static

orWhereTime() публичный статический Метод

Add an "or where time" statement to the query.
public static orWhereTime ( string $column, string $operator, integer $value ) : Builder | static
$column string
$operator string
$value integer
Результат Illuminate\Database\Query\Builder | static

orderBy() публичный статический Метод

Add an "order by" clause to the query.
public static orderBy ( string $column, string $direction = 'asc' )
$column string
$direction string

orderByRaw() публичный статический Метод

Add a raw "order by" clause to the query.
public static orderByRaw ( string $sql, array $bindings = [] )
$sql string
$bindings array

paginate() публичный статический Метод

Paginate the given query.
public static paginate ( integer $perPage = null, array $columns = [], string $pageName = 'page', integer | null $page = null ) : Illuminate\Contracts\Pagination\LengthAwarePaginator
$perPage integer
$columns array
$pageName string
$page integer | null
Результат Illuminate\Contracts\Pagination\LengthAwarePaginator

pluck() публичный статический Метод

Get an array with the values of a given column.
public static pluck ( string $column, string | null $key = null ) : Collection
$column string
$key string | null
Результат Illuminate\Support\Collection

raw() публичный статический Метод

Create a raw database expression.
public static raw ( mixed $value ) : Illuminate\Database\Query\Expression
$value mixed
Результат Illuminate\Database\Query\Expression

removedScopes() публичный статический Метод

Get an array of global scopes that were removed from the query.
public static removedScopes ( ) : array
Результат array

rightJoin() публичный статический Метод

Add a right join to the query.
public static rightJoin ( string $table, string $first, string $operator = null, string $second = null ) : Builder | static
$table string
$first string
$operator string
$second string
Результат Illuminate\Database\Query\Builder | static

rightJoinWhere() публичный статический Метод

Add a "right join where" clause to the query.
public static rightJoinWhere ( string $table, string $one, string $operator, string $two ) : Builder | static
$table string
$one string
$operator string
$two string
Результат Illuminate\Database\Query\Builder | static

scopes() публичный статический Метод

Add the given scopes to the current builder instance.
public static scopes ( array $scopes ) : mixed
$scopes array
Результат mixed

select() публичный статический Метод

Set the columns to be selected.
public static select ( array | mixed $columns = [] )
$columns array | mixed

selectRaw() публичный статический Метод

Add a new "raw" select expression to the query.
public static selectRaw ( string $expression, array $bindings = [] ) : Builder | static
$expression string
$bindings array
Результат Illuminate\Database\Query\Builder | static

selectSub() публичный статический Метод

Add a subselect expression to the query.
public static selectSub ( Closure | Builder | string $query, string $as ) : Builder | static
$query Closure | Illuminate\Database\Query\Builder | string
$as string
Результат Illuminate\Database\Query\Builder | static

setBindings() публичный статический Метод

Set the bindings on the query builder.
public static setBindings ( array $bindings, string $type = 'where' )
$bindings array
$type string

setEagerLoads() публичный статический Метод

Set the relationships being eagerly loaded.
public static setEagerLoads ( array $eagerLoad )
$eagerLoad array

setModel() публичный статический Метод

Set a model instance for the model being queried.
public static setModel ( Model $model )
$model Illuminate\Database\Eloquent\Model

setQuery() публичный статический Метод

Set the underlying query builder instance.
public static setQuery ( Builder $query )
$query Illuminate\Database\Query\Builder

sharedLock() публичный статический Метод

Share lock the selected rows in the table.
public static sharedLock ( ) : Builder
Результат Illuminate\Database\Query\Builder

simplePaginate() публичный статический Метод

Paginate the given query into a simple paginator.
public static simplePaginate ( integer $perPage = null, array $columns = [], string $pageName = 'page', integer | null $page = null ) : Illuminate\Contracts\Pagination\Paginator
$perPage integer
$columns array
$pageName string
$page integer | null
Результат Illuminate\Contracts\Pagination\Paginator

skip() публичный статический Метод

Alias to set the "offset" value of the query.
public static skip ( integer $value ) : Builder | static
$value integer
Результат Illuminate\Database\Query\Builder | static

sum() публичный статический Метод

Retrieve the sum of the values of a given column.
public static sum ( string $column ) : float | integer
$column string
Результат float | integer

take() публичный статический Метод

Alias to set the "limit" value of the query.
public static take ( integer $value ) : Builder | static
$value integer
Результат Illuminate\Database\Query\Builder | static

toBase() публичный статический Метод

Get a base query builder instance.
public static toBase ( ) : Builder
Результат Illuminate\Database\Query\Builder

toSql() публичный статический Метод

Get the SQL representation of the query.
public static toSql ( ) : string
Результат string

truncate() публичный статический Метод

Run a truncate statement on the table.
public static truncate ( ) : void
Результат void

union() публичный статический Метод

Add a union statement to the query.
public static union ( Builder | Closure $query, boolean $all = false ) : Builder | static
$query Illuminate\Database\Query\Builder | Closure
$all boolean
Результат Illuminate\Database\Query\Builder | static

unionAll() публичный статический Метод

Add a union all statement to the query.
public static unionAll ( Builder | Closure $query ) : Builder | static
$query Illuminate\Database\Query\Builder | Closure
Результат Illuminate\Database\Query\Builder | static

updateOrCreate() публичный статический Метод

Create or update a record matching the attributes, and fill it with values.
public static updateOrCreate ( array $attributes, array $values = [] ) : Model
$attributes array
$values array
Результат Illuminate\Database\Eloquent\Model

updateOrInsert() публичный статический Метод

Insert or update a record matching the attributes, and fill it with values.
public static updateOrInsert ( array $attributes, array $values = [] ) : boolean
$attributes array
$values array
Результат boolean

useWritePdo() публичный статический Метод

Use the write pdo for query.
public static useWritePdo ( )

value() публичный статический Метод

Get a single column's value from the first result of a query.
public static value ( string $column ) : mixed
$column string
Результат mixed

when() публичный статический Метод

Apply the callback's query changes if the given "value" is true.
public static when ( boolean $value, Closure $callback )
$value boolean
$callback Closure

where() публичный статический Метод

Add a basic where clause to the query.
public static where ( string $column, string $operator = null, mixed $value = null, string $boolean = 'and' )
$column string
$operator string
$value mixed
$boolean string

whereBetween() публичный статический Метод

Add a where between statement to the query.
public static whereBetween ( string $column, array $values, string $boolean = 'and', boolean $not = false )
$column string
$values array
$boolean string
$not boolean

whereColumn() публичный статический Метод

Add a "where" clause comparing two columns to the query.
public static whereColumn ( string | array $first, string | null $operator = null, string | null $second = null, string | null $boolean = 'and' ) : Builder | static
$first string | array
$operator string | null
$second string | null
$boolean string | null
Результат Illuminate\Database\Query\Builder | static

whereDate() публичный статический Метод

Add a "where date" statement to the query.
public static whereDate ( string $column, string $operator, integer $value, string $boolean = 'and' ) : Builder | static
$column string
$operator string
$value integer
$boolean string
Результат Illuminate\Database\Query\Builder | static

whereDay() публичный статический Метод

Add a "where day" statement to the query.
public static whereDay ( string $column, string $operator, integer $value, string $boolean = 'and' ) : Builder | static
$column string
$operator string
$value integer
$boolean string
Результат Illuminate\Database\Query\Builder | static

whereDoesntHave() публичный статический Метод

Add a relationship count / exists condition to the query with where clauses.
public static whereDoesntHave ( string $relation, Closure | null $callback = null ) : Builder | static
$relation string
$callback Closure | null
Результат Illuminate\Database\Eloquent\Builder | static

whereExists() публичный статический Метод

Add an exists clause to the query.
public static whereExists ( Closure $callback, string $boolean = 'and', boolean $not = false )
$callback Closure
$boolean string
$not boolean

whereHas() публичный статический Метод

Add a relationship count / exists condition to the query with where clauses.
public static whereHas ( string $relation, Closure $callback, string $operator = '>=', integer $count = 1 ) : Builder | static
$relation string
$callback Closure
$operator string
$count integer
Результат Illuminate\Database\Eloquent\Builder | static

whereIn() публичный статический Метод

Add a "where in" clause to the query.
public static whereIn ( string $column, mixed $values, string $boolean = 'and', boolean $not = false )
$column string
$values mixed
$boolean string
$not boolean

whereMonth() публичный статический Метод

Add a "where month" statement to the query.
public static whereMonth ( string $column, string $operator, integer $value, string $boolean = 'and' ) : Builder | static
$column string
$operator string
$value integer
$boolean string
Результат Illuminate\Database\Query\Builder | static

whereNested() публичный статический Метод

Add a nested where statement to the query.
public static whereNested ( Closure $callback, string $boolean = 'and' ) : Builder | static
$callback Closure
$boolean string
Результат Illuminate\Database\Query\Builder | static

whereNotBetween() публичный статический Метод

Add a where not between statement to the query.
public static whereNotBetween ( string $column, array $values, string $boolean = 'and' ) : Builder | static
$column string
$values array
$boolean string
Результат Illuminate\Database\Query\Builder | static

whereNotExists() публичный статический Метод

Add a where not exists clause to the query.
public static whereNotExists ( Closure $callback, string $boolean = 'and' ) : Builder | static
$callback Closure
$boolean string
Результат Illuminate\Database\Query\Builder | static

whereNotIn() публичный статический Метод

Add a "where not in" clause to the query.
public static whereNotIn ( string $column, mixed $values, string $boolean = 'and' ) : Builder | static
$column string
$values mixed
$boolean string
Результат Illuminate\Database\Query\Builder | static

whereNotNull() публичный статический Метод

Add a "where not null" clause to the query.
public static whereNotNull ( string $column, string $boolean = 'and' ) : Builder | static
$column string
$boolean string
Результат Illuminate\Database\Query\Builder | static

whereNull() публичный статический Метод

Add a "where null" clause to the query.
public static whereNull ( string $column, string $boolean = 'and', boolean $not = false )
$column string
$boolean string
$not boolean

whereRaw() публичный статический Метод

Add a raw where clause to the query.
public static whereRaw ( string $sql, array $bindings = [], string $boolean = 'and' )
$sql string
$bindings array
$boolean string

whereTime() публичный статический Метод

Add a "where time" statement to the query.
public static whereTime ( string $column, string $operator, integer $value, string $boolean = 'and' ) : Builder | static
$column string
$operator string
$value integer
$boolean string
Результат Illuminate\Database\Query\Builder | static

whereYear() публичный статический Метод

Add a "where year" statement to the query.
public static whereYear ( string $column, string $operator, integer $value, string $boolean = 'and' ) : Builder | static
$column string
$operator string
$value integer
$boolean string
Результат Illuminate\Database\Query\Builder | static

withCount() публичный статический Метод

Add subselect queries to count the relations.
public static withCount ( mixed $relations )
$relations mixed

withGlobalScope() публичный статический Метод

Register a new global scope.
public static withGlobalScope ( string $identifier, Illuminate\Database\Eloquent\Scope | Closure $scope )
$identifier string
$scope Illuminate\Database\Eloquent\Scope | Closure

without() публичный статический Метод

Prevent the specified relations from being eager loaded.
public static without ( mixed $relations )
$relations mixed

withoutGlobalScope() публичный статический Метод

Remove a registered global scope.
public static withoutGlobalScope ( Illuminate\Database\Eloquent\Scope | string $scope )
$scope Illuminate\Database\Eloquent\Scope | string

withoutGlobalScopes() публичный статический Метод

Remove all or passed registered global scopes.
public static withoutGlobalScopes ( array | null $scopes = null )
$scopes array | null