PHP 클래스 Eloquent, someline-starter

User: qixieyu Date: 15-7-3 Time: 下午8:41
상속: extends Db
파일 보기 프로젝트 열기: someline/someline-starter 1 사용 예제들

공개 메소드들

메소드 설명
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