October\Rain\Database\QueryBuilder

Extends:

  • Illuminate\Database\Query\Builder

QueryBuilder restores some features that were removed from base, it also adds some new ones

Public properties

There are no public properties in the class.

Show inherited public properties

Inherited public properties

  • public Illuminate\Database\ConnectionInterface $connection - defined in Illuminate\Database\Query\Builder. The database connection instance.
  • public Illuminate\Database\Query\Grammars\Grammar $grammar - defined in Illuminate\Database\Query\Builder. The database query grammar instance.
  • public Illuminate\Database\Query\Processors\Processor $processor - defined in Illuminate\Database\Query\Builder. The database query post processor instance.
  • public array $bindings - defined in Illuminate\Database\Query\Builder. The current query value bindings.
  • public array $aggregate - defined in Illuminate\Database\Query\Builder. An aggregate function and column to be run.
  • public array $columns - defined in Illuminate\Database\Query\Builder. The columns that should be returned.
  • public bool|array $distinct - defined in Illuminate\Database\Query\Builder. Indicates if the query returns distinct results.
  • public string $from - defined in Illuminate\Database\Query\Builder. The table which the query is targeting.
  • public array $joins - defined in Illuminate\Database\Query\Builder. The table joins for the query.
  • public array $wheres - defined in Illuminate\Database\Query\Builder. The where constraints for the query.
  • public array $groups - defined in Illuminate\Database\Query\Builder. The groupings for the query.
  • public array $havings - defined in Illuminate\Database\Query\Builder. The having constraints for the query.
  • public array $orders - defined in Illuminate\Database\Query\Builder. The orderings for the query.
  • public int $limit - defined in Illuminate\Database\Query\Builder. The maximum number of records to return.
  • public int $offset - defined in Illuminate\Database\Query\Builder. The number of records to skip.
  • public array $unions - defined in Illuminate\Database\Query\Builder. The query union statements.
  • public int $unionLimit - defined in Illuminate\Database\Query\Builder. The maximum number of union records to return.
  • public int $unionOffset - defined in Illuminate\Database\Query\Builder. The number of union records to skip.
  • public array $unionOrders - defined in Illuminate\Database\Query\Builder. The orderings for the union query.
  • public string|bool $lock - defined in Illuminate\Database\Query\Builder. Indicates whether row locking is being used.
  • public array $operators - defined in Illuminate\Database\Query\Builder. All of the available clause operators.
  • public bool $useWritePdo - defined in Illuminate\Database\Query\Builder. Whether use write pdo for select.

Protected properties

protected string $cacheKey

cacheKey is the key that should be used when caching the query

protected int $cacheMinutes

cacheMinutes is the number of minutes to cache the query

protected array $cacheTags

cacheTags is the tags for the query cache

protected bool $cachingDuplicateQueries

cachingDuplicateQueries indicates whether duplicate queries are being cached in memory

Show inherited protected properties

Inherited protected properties

  • protected static array $macros - defined in Illuminate\Database\Query\Builder. The registered string macros.

Public methods

public $this cacheTags(array|mixed $cacheTags)

Indicate that the results, if cached, should use the given cache tags.

Parameters
  • array|mixed $cacheTags

public bool cachingDuplicates()

Determine whether we're caching duplicate queries.

public Illuminate\Database\Query\Builder|static clearDuplicateCache(string|null $table=NULL)

Clear memory cache for the given table.

Parameters
  • string|null $table

public int count(string $columns='*')

Retrieve the "count" result of the query, also strips off any orderBy clause.

Parameters
  • string $columns

public int delete(mixed $id=NULL)

Delete a record from the database.

Parameters
  • mixed $id

public Illuminate\Database\Query\Builder|static disableDuplicateCache()

Disable the memory cache on the query.

public Illuminate\Database\Query\Builder|static enableDuplicateCache()

Enable the memory cache on the query.

public Illuminate\Database\Query\Builder|static flushDuplicateCache()

Flush the memory cache.

public string generateCacheKey()

Generate the unique cache key for the query.

public void get($columns=array( 0=>'*'))
Parameters
  • $columns

public void getCacheKey()

getCacheKey returns a unique cache key for the complete query

public void getCached($columns=array( 0=>'*'))

getCached executes the query as a cached "select" statement.

Parameters
  • $columns

public bool insert(array $values)

Insert a new record into the database.

Parameters
  • array $values

public int insertGetId(array $values, string $sequence=NULL)

Insert a new record and get the value of the primary key.

Parameters
  • array $values
  • string $sequence

public array lists(string $column, string|null $key=NULL)

Get an array with the values of a given column.

Parameters
  • string $column
  • string|null $key

public $this remember(DateTime|int $minutes, string $key=NULL)

Indicate that the query results should be cached.

Parameters
  • DateTime|int $minutes
  • string $key

public Illuminate\Database\Query\Builder|static rememberForever(string $key=NULL)

Indicate that the query results should be cached forever.

Parameters
  • string $key

public void truncate()

Run a truncate statement on the table.

public int update(array $values)

Update a record in the database.

Parameters
  • array $values

Show inherited public methods

Inherited public methods

  • public mixed __call(string $method, array $parameters) - defined in Illuminate\Database\Query\Builder. Handle dynamic method calls into the method.
  • public static mixed __callStatic(string $method, array $parameters) - defined in Illuminate\Database\Query\Builder. Dynamically handle calls to the class.
  • public void __construct(Illuminate\Database\ConnectionInterface $connection, Illuminate\Database\Query\Grammars\Grammar|null $grammar=NULL, Illuminate\Database\Query\Processors\Processor|null $processor=NULL) - defined in Illuminate\Database\Query\Builder. Create a new query builder instance.
  • public $this addBinding(mixed $value, string $type='where') - defined in Illuminate\Database\Query\Builder. Add a binding to the query.
  • public $this addNestedWhereQuery(Illuminate\Database\Query\Builder|static $query, string $boolean='and') - defined in Illuminate\Database\Query\Builder. Add another query builder as a nested where to the query builder.
  • public $this addSelect(array|mixed $column) - defined in Illuminate\Database\Query\Builder. Add a new select column to the query.
  • public $this addWhereExistsQuery(Illuminate\Database\Query\Builder $query, string $boolean='and', bool $not=false) - defined in Illuminate\Database\Query\Builder. Add an exists clause to the query.
  • public mixed aggregate(string $function, array $columns=array( 0=>'*')) - defined in Illuminate\Database\Query\Builder. Execute an aggregate function on the database.
  • public mixed average(string $column) - defined in Illuminate\Database\Query\Builder. Alias for the "avg" method.
  • public mixed avg(string $column) - defined in Illuminate\Database\Query\Builder. Retrieve the average of the values of a given column.
  • public bool chunk(int $count, callable $callback) - defined in Illuminate\Database\Query\Builder. Chunk the results of the query.
  • public bool chunkById(int $count, callable $callback, string|null $column=NULL, string|null $alias=NULL) - defined in Illuminate\Database\Query\Builder. Chunk the results of a query by comparing IDs.
  • public static cloneWithout(array $properties) - defined in Illuminate\Database\Query\Builder. Clone the query without the given properties.
  • public static cloneWithoutBindings(array $except) - defined in Illuminate\Database\Query\Builder. Clone the query without the given bindings.
  • public Illuminate\Database\Query\Builder|static crossJoin(string $table, Closure|string|null $first=NULL, string|null $operator=NULL, string|null $second=NULL) - defined in Illuminate\Database\Query\Builder. Add a "cross join" clause to the query.
  • public Illuminate\Support\LazyCollection cursor() - defined in Illuminate\Database\Query\Builder. Get a lazy collection for the given query.
  • public void dd() - defined in Illuminate\Database\Query\Builder. Die and dump the current SQL and bindings.
  • public int decrement(string $column, float|int $amount=1, array $extra=array()) - defined in Illuminate\Database\Query\Builder. Decrement a column's value by a given amount.
  • public $this distinct() - defined in Illuminate\Database\Query\Builder. Force the query to only return distinct results.
  • public bool doesntExist() - defined in Illuminate\Database\Query\Builder. Determine if no rows exist for the current query.
  • public mixed doesntExistOr(Closure $callback) - defined in Illuminate\Database\Query\Builder. Execute the given callback if rows exist for the current query.
  • public $this dump() - defined in Illuminate\Database\Query\Builder. Dump the current SQL and bindings.
  • public $this dynamicWhere(string $method, array $parameters) - defined in Illuminate\Database\Query\Builder. Handles dynamic "where" clauses to the query.
  • public bool each(callable $callback, int $count=1000) - defined in Illuminate\Database\Query\Builder. Execute a callback over each item while chunking.
  • public bool eachById(callable $callback, int $count=1000, string|null $column=NULL, string|null $alias=NULL) - defined in Illuminate\Database\Query\Builder. Execute a callback over each item while chunking by id.
  • public bool exists() - defined in Illuminate\Database\Query\Builder. Determine if any rows exist for the current query.
  • public mixed existsOr(Closure $callback) - defined in Illuminate\Database\Query\Builder. Execute the given callback if no rows exist for the current query.
  • public mixed|static find(int|string $id, array $columns=array( 0=>'*')) - defined in Illuminate\Database\Query\Builder. Execute a query for a single record by ID.
  • public Illuminate\Database\Eloquent\Model|object|static|null first(array|string $columns=array( 0=>'*')) - defined in Illuminate\Database\Query\Builder. Execute the query and get the first result.
  • public Illuminate\Database\Query\Builder forNestedWhere() - defined in Illuminate\Database\Query\Builder. Create a new query instance for nested where condition.
  • public Illuminate\Database\Query\Builder|static forPage(int $page, int $perPage=15) - defined in Illuminate\Database\Query\Builder. Set the limit and offset for a given page.
  • public Illuminate\Database\Query\Builder|static forPageAfterId(int $perPage=15, int|null $lastId=0, string $column='id') - defined in Illuminate\Database\Query\Builder. Constrain the query to the next "page" of results after a given ID.
  • public Illuminate\Database\Query\Builder|static forPageBeforeId(int $perPage=15, int|null $lastId=0, string $column='id') - defined in Illuminate\Database\Query\Builder. Constrain the query to the previous "page" of results before a given ID.
  • public $this from(Closure|\Illuminate\Database\Query\Builder|string $table, string|null $as=NULL) - defined in Illuminate\Database\Query\Builder. Set the table which the query is targeting.
  • public Illuminate\Database\Query\Builder|static fromRaw(string $expression, mixed $bindings=array()) - defined in Illuminate\Database\Query\Builder. Add a raw from clause to the query.
  • public Illuminate\Database\Query\Builder|static fromSub(Closure|\Illuminate\Database\Query\Builder|string $query, string $as) - defined in Illuminate\Database\Query\Builder. Makes "from" fetch from a subquery.
  • public array getBindings() - defined in Illuminate\Database\Query\Builder. Get the current query value bindings in a flattened array.
  • public Illuminate\Database\ConnectionInterface getConnection() - defined in Illuminate\Database\Query\Builder. Get the database connection instance.
  • public int getCountForPagination(array $columns=array( 0=>'*')) - defined in Illuminate\Database\Query\Builder. Get the count of the total records for the paginator.
  • public Illuminate\Database\Query\Grammars\Grammar getGrammar() - defined in Illuminate\Database\Query\Builder. Get the query grammar instance.
  • public Illuminate\Database\Query\Processors\Processor getProcessor() - defined in Illuminate\Database\Query\Builder. Get the database query processor instance.
  • public array getRawBindings() - defined in Illuminate\Database\Query\Builder. Get the raw array of bindings.
  • public $this groupBy(array|string $groups=NULL) - defined in Illuminate\Database\Query\Builder. Add a "group by" clause to the query.
  • public $this groupByRaw(string $sql, array $bindings=array()) - defined in Illuminate\Database\Query\Builder. Add a raw groupBy clause to the query.
  • public static bool hasMacro(string $name) - defined in Illuminate\Database\Query\Builder. Checks if macro is registered.
  • public $this having(string $column, string|null $operator=NULL, string|null $value=NULL, string $boolean='and') - defined in Illuminate\Database\Query\Builder. Add a "having" clause to the query.
  • public Illuminate\Database\Query\Builder|static havingBetween(string $column, array $values, string $boolean='and', bool $not=false) - defined in Illuminate\Database\Query\Builder. Add a "having between " clause to the query.
  • public $this havingRaw(string $sql, array $bindings=array(), string $boolean='and') - defined in Illuminate\Database\Query\Builder. Add a raw having clause to the query.
  • public string implode(string $column, string $glue='') - defined in Illuminate\Database\Query\Builder. Concatenate values of a given column as a string.
  • public $this inRandomOrder(string $seed='') - defined in Illuminate\Database\Query\Builder. Put the query's results in random order.
  • public int increment(string $column, float|int $amount=1, array $extra=array()) - defined in Illuminate\Database\Query\Builder. Increment a column's value by a given amount.
  • public int insertOrIgnore(array $values) - defined in Illuminate\Database\Query\Builder. Insert a new record into the database while ignoring errors.
  • public int insertUsing(array $columns, Closure|\Illuminate\Database\Query\Builder|string $query) - defined in Illuminate\Database\Query\Builder. Insert new records into the table using a subquery.
  • public $this join(string $table, Closure|string $first, string|null $operator=NULL, string|null $second=NULL, string $type='inner', bool $where=false) - defined in Illuminate\Database\Query\Builder. Add a join clause to the query.
  • public Illuminate\Database\Query\Builder|static joinSub(Closure|\Illuminate\Database\Query\Builder|string $query, string $as, Closure|string $first, string|null $operator=NULL, string|null $second=NULL, string $type='inner', bool $where=false) - defined in Illuminate\Database\Query\Builder. Add a subquery join clause to the query.
  • public Illuminate\Database\Query\Builder|static joinWhere(string $table, Closure|string $first, string $operator, string $second, string $type='inner') - defined in Illuminate\Database\Query\Builder. Add a "join where" clause to the query.
  • public Illuminate\Database\Query\Builder|static latest(string $column='created_at') - defined in Illuminate\Database\Query\Builder. Add an "order by" clause for a timestamp to the query.
  • public Illuminate\Database\Query\Builder|static leftJoin(string $table, Closure|string $first, string|null $operator=NULL, string|null $second=NULL) - defined in Illuminate\Database\Query\Builder. Add a left join to the query.
  • public Illuminate\Database\Query\Builder|static leftJoinSub(Closure|\Illuminate\Database\Query\Builder|string $query, string $as, Closure|string $first, string|null $operator=NULL, string|null $second=NULL) - defined in Illuminate\Database\Query\Builder. Add a subquery left join to the query.
  • public Illuminate\Database\Query\Builder|static leftJoinWhere(string $table, Closure|string $first, string $operator, string $second) - defined in Illuminate\Database\Query\Builder. Add a "join where" clause to the query.
  • public $this limit(int $value) - defined in Illuminate\Database\Query\Builder. Set the "limit" value of the query.
  • public $this lock(string|bool $value=true) - defined in Illuminate\Database\Query\Builder. Lock the selected rows in the table.
  • public Illuminate\Database\Query\Builder lockForUpdate() - defined in Illuminate\Database\Query\Builder. Lock the selected rows in the table for updating.
  • public static void macro(string $name, object|callable $macro) - defined in Illuminate\Database\Query\Builder. Register a custom macro.
  • public mixed macroCall(string $method, array $parameters) - defined in Illuminate\Database\Query\Builder. Dynamically handle calls to the class.
  • public mixed max(string $column) - defined in Illuminate\Database\Query\Builder. Retrieve the maximum value of a given column.
  • public $this mergeBindings(Illuminate\Database\Query\Builder $query) - defined in Illuminate\Database\Query\Builder. Merge an array of bindings into our bindings.
  • public void mergeWheres(array $wheres, array $bindings) - defined in Illuminate\Database\Query\Builder. Merge an array of where clauses and bindings.
  • public mixed min(string $column) - defined in Illuminate\Database\Query\Builder. Retrieve the minimum value of a given column.
  • public static void mixin(object $mixin, bool $replace=true) - defined in Illuminate\Database\Query\Builder. Mix another object into the class.
  • public Illuminate\Database\Query\Builder newQuery() - defined in Illuminate\Database\Query\Builder. Get a new instance of the query builder.
  • public float|int numericAggregate(string $function, array $columns=array( 0=>'*')) - defined in Illuminate\Database\Query\Builder. Execute a numeric aggregate function on the database.
  • public $this offset(int $value) - defined in Illuminate\Database\Query\Builder. Set the "offset" value of the query.
  • public Illuminate\Database\Query\Builder|static oldest(string $column='created_at') - defined in Illuminate\Database\Query\Builder. Add an "order by" clause for a timestamp to the query.
  • public Illuminate\Database\Query\Builder|static orHaving(string $column, string|null $operator=NULL, string|null $value=NULL) - defined in Illuminate\Database\Query\Builder. Add a "or having" clause to the query.
  • public Illuminate\Database\Query\Builder|static orHavingRaw(string $sql, array $bindings=array()) - defined in Illuminate\Database\Query\Builder. Add a raw or having clause to the query.
  • public Illuminate\Database\Query\Builder|static orWhere(Closure|string|array $column, mixed $operator=NULL, mixed $value=NULL) - defined in Illuminate\Database\Query\Builder. Add an "or where" clause to the query.
  • public Illuminate\Database\Query\Builder|static orWhereBetween(string $column, array $values) - defined in Illuminate\Database\Query\Builder. Add an or where between statement to the query.
  • public Illuminate\Database\Query\Builder|static orWhereColumn(string|array $first, string|null $operator=NULL, string|null $second=NULL) - defined in Illuminate\Database\Query\Builder. Add an "or where" clause comparing two columns to the query.
  • public Illuminate\Database\Query\Builder|static orWhereDate(string $column, string $operator, DateTimeInterface|string|null $value=NULL) - defined in Illuminate\Database\Query\Builder. Add an "or where date" statement to the query.
  • public Illuminate\Database\Query\Builder|static orWhereDay(string $column, string $operator, DateTimeInterface|string|null $value=NULL) - defined in Illuminate\Database\Query\Builder. Add an "or where day" statement to the query.
  • public Illuminate\Database\Query\Builder|static orWhereExists(Closure $callback, bool $not=false) - defined in Illuminate\Database\Query\Builder. Add an or exists clause to the query.
  • public Illuminate\Database\Query\Builder|static orWhereIn(string $column, mixed $values) - defined in Illuminate\Database\Query\Builder. Add an "or where in" clause to the query.
  • public $this orWhereJsonContains(string $column, mixed $value) - defined in Illuminate\Database\Query\Builder. Add a "or where JSON contains" clause to the query.
  • public $this orWhereJsonDoesntContain(string $column, mixed $value) - defined in Illuminate\Database\Query\Builder. Add a "or where JSON not contains" clause to the query.
  • public $this orWhereJsonLength(string $column, mixed $operator, mixed $value=NULL) - defined in Illuminate\Database\Query\Builder. Add a "or where JSON length" clause to the query.
  • public Illuminate\Database\Query\Builder|static orWhereMonth(string $column, string $operator, DateTimeInterface|string|null $value=NULL) - defined in Illuminate\Database\Query\Builder. Add an "or where month" statement to the query.
  • public Illuminate\Database\Query\Builder|static orWhereNotBetween(string $column, array $values) - defined in Illuminate\Database\Query\Builder. Add an or where not between statement to the query.
  • public Illuminate\Database\Query\Builder|static orWhereNotExists(Closure $callback) - defined in Illuminate\Database\Query\Builder. Add a where not exists clause to the query.
  • public Illuminate\Database\Query\Builder|static orWhereNotIn(string $column, mixed $values) - defined in Illuminate\Database\Query\Builder. Add an "or where not in" clause to the query.
  • public Illuminate\Database\Query\Builder|static orWhereNotNull(string $column) - defined in Illuminate\Database\Query\Builder. Add an "or where not null" clause to the query.
  • public Illuminate\Database\Query\Builder|static orWhereNull(string $column) - defined in Illuminate\Database\Query\Builder. Add an "or where null" clause to the query.
  • public Illuminate\Database\Query\Builder|static orWhereRaw(string $sql, mixed $bindings=array()) - defined in Illuminate\Database\Query\Builder. Add a raw or where clause to the query.
  • public $this orWhereRowValues(array $columns, string $operator, array $values) - defined in Illuminate\Database\Query\Builder. Adds a or where condition using row values.
  • public Illuminate\Database\Query\Builder|static orWhereTime(string $column, string $operator, DateTimeInterface|string|null $value=NULL) - defined in Illuminate\Database\Query\Builder. Add an "or where time" statement to the query.
  • public Illuminate\Database\Query\Builder|static orWhereYear(string $column, string $operator, DateTimeInterface|string|int|null $value=NULL) - defined in Illuminate\Database\Query\Builder. Add an "or where year" statement to the query.
  • public $this orderBy(Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Query\Expression|string $column, string $direction='asc') - defined in Illuminate\Database\Query\Builder. Add an "order by" clause to the query.
  • public $this orderByDesc(string $column) - defined in Illuminate\Database\Query\Builder. Add a descending "order by" clause to the query.
  • public $this orderByRaw(string $sql, array $bindings=array()) - defined in Illuminate\Database\Query\Builder. Add a raw "order by" clause to the query.
  • public Illuminate\Contracts\Pagination\LengthAwarePaginator paginate(int $perPage=15, array $columns=array( 0=>'*'), string $pageName='page', int|null $page=NULL) - defined in Illuminate\Database\Query\Builder. Paginate the given query into a simple paginator.
  • public Illuminate\Support\Collection pluck(string $column, string|null $key=NULL) - defined in Illuminate\Database\Query\Builder. Get an array with the values of a given column.
  • public array prepareValueAndOperator(string $value, string $operator, bool $useDefault=false) - defined in Illuminate\Database\Query\Builder. Prepare the value and operator for a where clause.
  • public Illuminate\Database\Query\Expression raw(mixed $value) - defined in Illuminate\Database\Query\Builder. Create a raw database expression.
  • public Illuminate\Database\Query\Builder|static rightJoin(string $table, Closure|string $first, string|null $operator=NULL, string|null $second=NULL) - defined in Illuminate\Database\Query\Builder. Add a right join to the query.
  • public Illuminate\Database\Query\Builder|static rightJoinSub(Closure|\Illuminate\Database\Query\Builder|string $query, string $as, Closure|string $first, string|null $operator=NULL, string|null $second=NULL) - defined in Illuminate\Database\Query\Builder. Add a subquery right join to the query.
  • public Illuminate\Database\Query\Builder|static rightJoinWhere(string $table, Closure|string $first, string $operator, string $second) - defined in Illuminate\Database\Query\Builder. Add a "right join where" clause to the query.
  • public $this select(array|mixed $columns=array( 0=>'*')) - defined in Illuminate\Database\Query\Builder. Set the columns to be selected.
  • public Illuminate\Database\Query\Builder|static selectRaw(string $expression, array $bindings=array()) - defined in Illuminate\Database\Query\Builder. Add a new "raw" select expression to the query.
  • public Illuminate\Database\Query\Builder|static selectSub(Closure|$this|string $query, string $as) - defined in Illuminate\Database\Query\Builder. Add a subselect expression to the query.
  • public $this setBindings(array $bindings, string $type='where') - defined in Illuminate\Database\Query\Builder. Set the bindings on the query builder.
  • public Illuminate\Database\Query\Builder sharedLock() - defined in Illuminate\Database\Query\Builder. Share lock the selected rows in the table.
  • public Illuminate\Contracts\Pagination\Paginator simplePaginate(int $perPage=15, array $columns=array( 0=>'*'), string $pageName='page', int|null $page=NULL) - defined in Illuminate\Database\Query\Builder. Get a paginator only supporting simple next and previous links.
  • public Illuminate\Database\Query\Builder|static skip(int $value) - defined in Illuminate\Database\Query\Builder. Alias to set the "offset" value of the query.
  • public mixed sum(string $column) - defined in Illuminate\Database\Query\Builder. Retrieve the sum of the values of a given column.
  • public Illuminate\Database\Query\Builder|static take(int $value) - defined in Illuminate\Database\Query\Builder. Alias to set the "limit" value of the query.
  • public $this tap(callable $callback) - defined in Illuminate\Database\Query\Builder. Pass the query to a given callback.
  • public string toSql() - defined in Illuminate\Database\Query\Builder. Get the SQL representation of the query.
  • public Illuminate\Database\Query\Builder|static union(Illuminate\Database\Query\Builder|\Closure $query, bool $all=false) - defined in Illuminate\Database\Query\Builder. Add a union statement to the query.
  • public Illuminate\Database\Query\Builder|static unionAll(Illuminate\Database\Query\Builder|\Closure $query) - defined in Illuminate\Database\Query\Builder. Add a union all statement to the query.
  • public mixed|$this unless(mixed $value, callable $callback, callable|null $default=NULL) - defined in Illuminate\Database\Query\Builder. Apply the callback's query changes if the given "value" is false.
  • public bool updateOrInsert(array $attributes, array $values=array()) - defined in Illuminate\Database\Query\Builder. Insert or update a record matching the attributes, and fill it with values.
  • public $this useWritePdo() - defined in Illuminate\Database\Query\Builder. Use the write pdo for query.
  • public mixed value(string $column) - defined in Illuminate\Database\Query\Builder. Get a single column's value from the first result of a query.
  • public mixed|$this when(mixed $value, callable $callback, callable|null $default=NULL) - defined in Illuminate\Database\Query\Builder. Apply the callback's query changes if the given "value" is true.
  • public $this where(Closure|string|array $column, mixed $operator=NULL, mixed $value=NULL, string $boolean='and') - defined in Illuminate\Database\Query\Builder. Add a basic where clause to the query.
  • public $this whereBetween(string $column, array $values, string $boolean='and', bool $not=false) - defined in Illuminate\Database\Query\Builder. Add a where between statement to the query.
  • public Illuminate\Database\Query\Builder|static whereColumn(string|array $first, string|null $operator=NULL, string|null $second=NULL, string|null $boolean='and') - defined in Illuminate\Database\Query\Builder. Add a "where" clause comparing two columns to the query.
  • public Illuminate\Database\Query\Builder|static whereDate(string $column, string $operator, DateTimeInterface|string|null $value=NULL, string $boolean='and') - defined in Illuminate\Database\Query\Builder. Add a "where date" statement to the query.
  • public Illuminate\Database\Query\Builder|static whereDay(string $column, string $operator, DateTimeInterface|string|null $value=NULL, string $boolean='and') - defined in Illuminate\Database\Query\Builder. Add a "where day" statement to the query.
  • public $this whereExists(Closure $callback, string $boolean='and', bool $not=false) - defined in Illuminate\Database\Query\Builder. Add an exists clause to the query.
  • public $this whereIn(string $column, mixed $values, string $boolean='and', bool $not=false) - defined in Illuminate\Database\Query\Builder. Add a "where in" clause to the query.
  • public $this whereIntegerInRaw(string $column, Illuminate\Contracts\Support\Arrayable|array $values, string $boolean='and', bool $not=false) - defined in Illuminate\Database\Query\Builder. Add a "where in raw" clause for integer values to the query.
  • public $this whereIntegerNotInRaw(string $column, Illuminate\Contracts\Support\Arrayable|array $values, string $boolean='and') - defined in Illuminate\Database\Query\Builder. Add a "where not in raw" clause for integer values to the query.
  • public $this whereJsonContains(string $column, mixed $value, string $boolean='and', bool $not=false) - defined in Illuminate\Database\Query\Builder. Add a "where JSON contains" clause to the query.
  • public $this whereJsonDoesntContain(string $column, mixed $value, string $boolean='and') - defined in Illuminate\Database\Query\Builder. Add a "where JSON not contains" clause to the query.
  • public $this whereJsonLength(string $column, mixed $operator, mixed $value=NULL, string $boolean='and') - defined in Illuminate\Database\Query\Builder. Add a "where JSON length" clause to the query.
  • public Illuminate\Database\Query\Builder|static whereMonth(string $column, string $operator, DateTimeInterface|string|null $value=NULL, string $boolean='and') - defined in Illuminate\Database\Query\Builder. Add a "where month" statement to the query.
  • public Illuminate\Database\Query\Builder|static whereNested(Closure $callback, string $boolean='and') - defined in Illuminate\Database\Query\Builder. Add a nested where statement to the query.
  • public Illuminate\Database\Query\Builder|static whereNotBetween(string $column, array $values, string $boolean='and') - defined in Illuminate\Database\Query\Builder. Add a where not between statement to the query.
  • public Illuminate\Database\Query\Builder|static whereNotExists(Closure $callback, string $boolean='and') - defined in Illuminate\Database\Query\Builder. Add a where not exists clause to the query.
  • public Illuminate\Database\Query\Builder|static whereNotIn(string $column, mixed $values, string $boolean='and') - defined in Illuminate\Database\Query\Builder. Add a "where not in" clause to the query.
  • public Illuminate\Database\Query\Builder|static whereNotNull(string|array $columns, string $boolean='and') - defined in Illuminate\Database\Query\Builder. Add a "where not null" clause to the query.
  • public $this whereNull(string|array $columns, string $boolean='and', bool $not=false) - defined in Illuminate\Database\Query\Builder. Add a "where null" clause to the query.
  • public $this whereRaw(string $sql, mixed $bindings=array(), string $boolean='and') - defined in Illuminate\Database\Query\Builder. Add a raw where clause to the query.
  • public $this whereRowValues(array $columns, string $operator, array $values, string $boolean='and') - defined in Illuminate\Database\Query\Builder. Adds a where condition using row values.
  • public Illuminate\Database\Query\Builder|static whereTime(string $column, string $operator, DateTimeInterface|string|null $value=NULL, string $boolean='and') - defined in Illuminate\Database\Query\Builder. Add a "where time" statement to the query.
  • public Illuminate\Database\Query\Builder|static whereYear(string $column, string $operator, DateTimeInterface|string|int|null $value=NULL, string $boolean='and') - defined in Illuminate\Database\Query\Builder. Add a "where year" statement to the query.

Protected methods

protected Illuminate\Cache\CacheManager getCache()

Get the cache object with tags assigned, if applicable.

protected Closure getCacheCallback(array $columns)

Get the Closure callback used when caching queries.

Parameters
  • array $columns

protected void getCacheInfo()

getCacheInfo returns key and cache minutes

protected void getDuplicateCached($columns=array( 0=>'*'))

getDuplicateCached checks the memory cache before executing the query

Parameters
  • $columns

Show inherited protected methods

Inherited protected methods

  • protected $this addArrayOfWheres(array $column, string $boolean, string $method='where') - defined in Illuminate\Database\Query\Builder. Add an array of where clauses to the query.
  • protected $this addDateBasedWhere(string $type, string $column, string $operator, mixed $value, string $boolean='and') - defined in Illuminate\Database\Query\Builder. Add a date based (year, month, day, time) statement to the query.
  • protected void addDynamic(string $segment, string $connector, array $parameters, int $index) - defined in Illuminate\Database\Query\Builder. Add a single dynamic where clause statement to the query.
  • protected array cleanBindings(array $bindings) - defined in Illuminate\Database\Query\Builder. Remove all of the expressions from a list of bindings.
  • protected array createSub(Closure|\Illuminate\Database\Query\Builder|string $query) - defined in Illuminate\Database\Query\Builder. Creates a subquery and parse it.
  • protected string defaultKeyName() - defined in Illuminate\Database\Query\Builder. Get the default key name of the table.
  • protected void enforceOrderBy() - defined in Illuminate\Database\Query\Builder. Throw an exception if the query doesn't have an orderBy clause.
  • protected mixed flattenValue(mixed $value) - defined in Illuminate\Database\Query\Builder. Get a scalar type value from an unknown type of input.
  • protected Illuminate\Database\Query\Builder forSubQuery() - defined in Illuminate\Database\Query\Builder. Create a new query instance for a sub-query.
  • protected mixed forwardCallTo(mixed $object, string $method, array $parameters) - defined in Illuminate\Database\Query\Builder. Forward a method call to the given object.
  • protected bool invalidOperator(string $operator) - defined in Illuminate\Database\Query\Builder. Determine if the given operator is supported.
  • protected bool invalidOperatorAndValue(string $operator, mixed $value) - defined in Illuminate\Database\Query\Builder. Determine if the given operator and value combination is legal.
  • protected bool isQueryable(mixed $value) - defined in Illuminate\Database\Query\Builder. Determine if the value is a query builder instance or a Closure.
  • protected Illuminate\Database\Query\JoinClause newJoinClause(Illuminate\Database\Query\Builder $parentQuery, string $type, string $table) - defined in Illuminate\Database\Query\Builder. Get a new join clause.
  • protected mixed onceWithColumns(array $columns, callable $callback) - defined in Illuminate\Database\Query\Builder. Execute the given callback while selecting the given columns.
  • protected Illuminate\Pagination\LengthAwarePaginator paginator(Illuminate\Support\Collection $items, int $total, int $perPage, int $currentPage, array $options) - defined in Illuminate\Database\Query\Builder. Create a new length-aware paginator instance.
  • protected array parseSub(mixed $query) - defined in Illuminate\Database\Query\Builder. Parse the subquery into SQL and bindings.
  • protected Illuminate\Support\Collection pluckFromArrayColumn(array $queryResult, string $column, string $key) - defined in Illuminate\Database\Query\Builder. Retrieve column values from rows represented as arrays.
  • protected Illuminate\Support\Collection pluckFromObjectColumn(array $queryResult, string $column, string $key) - defined in Illuminate\Database\Query\Builder. Retrieve column values from rows represented as objects.
  • protected array removeExistingOrdersFor(string $column) - defined in Illuminate\Database\Query\Builder. Get an array with all orders with a given column removed.
  • protected array runPaginationCountQuery(array $columns=array( 0=>'*')) - defined in Illuminate\Database\Query\Builder. Run a pagination count query.
  • protected array runSelect() - defined in Illuminate\Database\Query\Builder. Run the query as a "select" statement against the connection.
  • protected $this setAggregate(string $function, array $columns) - defined in Illuminate\Database\Query\Builder. Set the aggregate property without running the query.
  • protected Illuminate\Pagination\Paginator simplePaginator(Illuminate\Support\Collection $items, int $perPage, int $currentPage, array $options) - defined in Illuminate\Database\Query\Builder. Create a new simple paginator instance.
  • protected string|null stripTableForPluck(string $column) - defined in Illuminate\Database\Query\Builder. Strip off the table name or alias from a column identifier.
  • protected static void throwBadMethodCallException(string $method) - defined in Illuminate\Database\Query\Builder. Throw a bad method call exception for the given method.
  • protected $this whereSub(string $column, string $operator, Closure $callback, string $boolean) - defined in Illuminate\Database\Query\Builder. Add a full sub-select to the query.
  • protected array withoutSelectAliases(array $columns) - defined in Illuminate\Database\Query\Builder. Remove the column aliases since they will break count queries.