메소드 |
설명 |
|
__call ( string $method, array $parameters ) : mixed |
Handle dynamic method calls into the method. |
|
__construct ( Illuminate\Database\ConnectionInterface $connection, Illuminate\Database\Query\Grammars\Grammar $grammar = null, Illuminate\Database\Query\Processors\Processor $processor = null ) : void |
Create a new query builder instance. |
|
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 = ['*'] ) : mixed |
Execute an aggregate function on the database. |
|
average ( string $column ) : mixed |
Alias for the "avg" method. |
|
avg ( string $column ) : mixed |
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', string $alias = null ) : 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. |
|
decrement ( string $column, integer $amount = 1, array $extra = [] ) : integer |
Decrement a column's value by a given amount. |
|
delete ( mixed $id = null ) : integer |
Delete a record from the database. |
|
distinct ( ) |
Force the query to only return distinct results. |
|
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. |
|
exists ( ) : boolean |
Determine if any rows exist for the current query. |
|
find ( integer $id, array $columns = ['*'] ) : mixed | static |
Execute a query for a single record by ID. |
|
first ( array $columns = ['*'] ) : stdClass | array | null |
Execute the query and get the first result. |
|
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 = ['*'] ) : Collection |
Execute the query as a "select" statement. |
|
getBindings ( ) : array |
Get the current query value bindings in a flattened array. |
|
getConnection ( ) : Illuminate\Database\ConnectionInterface |
Get the database connection instance. |
|
getCountForPagination ( array $columns = ['*'] ) : integer |
Get the count of the total records for the paginator. |
|
getGrammar ( ) : Illuminate\Database\Query\Grammars\Grammar |
Get the query grammar instance. |
|
getProcessor ( ) : Illuminate\Database\Query\Processors\Processor |
Get the database query processor instance. |
|
getRawBindings ( ) : array |
Get the raw array of bindings. |
|
groupBy ( $groups ) |
Add a "group by" clause to the query. |
|
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. |
|
increment ( string $column, integer $amount = 1, array $extra = [] ) : integer |
Increment a column's value by a given amount. |
|
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. |
|
lock ( boolean $value = true ) |
Lock the selected rows in the table. |
|
lockForUpdate ( ) : Builder |
Lock the selected rows in the table for updating. |
|
macroCall ( ) |
|
|
max ( string $column ) : mixed |
Retrieve the maximum value of a given column. |
|
mergeBindings ( Builder $query ) |
Merge an array of bindings into our bindings. |
|
mergeWheres ( array $wheres, array $bindings ) : void |
Merge an array of where clauses and bindings. |
|
min ( string $column ) : mixed |
Retrieve the minimum value of a given column. |
|
newQuery ( ) : Builder |
Get a new instance of the query builder. |
|
numericAggregate ( string $function, array $columns = ['*'] ) : float | integer |
Execute a numeric aggregate function on the database. |
|
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. |
|
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 ( Closure | 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, string $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. |
|
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 = 15, array $columns = ['*'], string $pageName = 'page', integer | null $page = null ) : Illuminate\Contracts\Pagination\LengthAwarePaginator |
Paginate the given query into a simple paginator. |
|
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. |
|
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. |
|
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. |
|
sharedLock ( ) : Builder |
Share lock the selected rows in the table. |
|
simplePaginate ( integer $perPage = 15, array $columns = ['*'], string $pageName = 'page', integer | null $page = null ) : Illuminate\Contracts\Pagination\Paginator |
Get a paginator only supporting simple next and previous links. |
|
skip ( integer $value ) : Builder | static |
Alias to set the "offset" value of the query. |
|
sum ( string $column ) : mixed |
Retrieve the sum of the values of a given column. |
|
take ( integer $value ) : Builder | static |
Alias to set the "limit" value of the query. |
|
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. |
|
update ( array $values ) : integer |
Update a record in the database. |
|
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, Closure $default = null ) : Builder |
Apply the callback's query changes if the given "value" is true. |
|
where ( string | array | Closure $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, mixed $value = null, string $boolean = 'and' ) : Builder | static |
Add a "where date" statement to the query. |
|
whereDay ( string $column, string $operator, mixed $value = null, string $boolean = 'and' ) : Builder | static |
Add a "where day" statement to the query. |
|
whereExists ( Closure $callback, string $boolean = 'and', boolean $not = false ) |
Add an exists clause to the query. |
|
whereIn ( string $column, mixed $values, string $boolean = 'and', boolean $not = false ) |
Add a "where in" clause to the query. |
|
whereMonth ( string $column, string $operator, mixed $value = null, 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, mixed $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, mixed $value = null, string $boolean = 'and' ) : Builder | static |
Add a "where year" statement to the query. |
|