Methods summary
public
|
|
public
Laravel\Database\Query
|
#
distinct( )
Force the query to return distinct results.
Force the query to return distinct results.
Returns
|
public
Laravel\Database\Query
|
#
select( array $columns = array('*') )
Add an array of columns to the SELECT clause.
Add an array of columns to the SELECT clause.
Parameters
Returns
|
public
Laravel\Database\Query
|
#
join( string $table, string $column1, string $operator = null, string $column2 = null, string $type = 'INNER' )
Add a join clause to the query.
Add a join clause to the query.
Parameters
- $table
string $table
- $column1
string $column1
- $operator
string $operator
- $column2
string $column2
- $type
string $type
Returns
|
public
Laravel\Database\Query
|
#
left_join( string $table, string $column1, string $operator = null, string $column2 = null )
Add a left join to the query.
Add a left join to the query.
Parameters
- $table
string $table
- $column1
string $column1
- $operator
string $operator
- $column2
string $column2
Returns
|
public
|
#
reset_where( )
Reset the where clause to its initial state.
Reset the where clause to its initial state.
|
public
Laravel\Database\Query
|
#
raw_where( string $where, array $bindings = array(), string $connector = 'AND' )
Add a raw where condition to the query.
Add a raw where condition to the query.
Parameters
- $where
string $where
- $bindings
array $bindings
- $connector
string $connector
Returns
|
public
Laravel\Database\Query
|
#
raw_or_where( string $where, array $bindings = array() )
Add a raw or where condition to the query.
Add a raw or where condition to the query.
Parameters
- $where
string $where
- $bindings
array $bindings
Returns
|
public
Laravel\Database\Query
|
#
where( string $column, string $operator = null, mixed $value = null, string $connector = 'AND' )
Add a where condition to the query.
Add a where condition to the query.
Parameters
- $column
string $column
- $operator
string $operator
- $value
mixed $value
- $connector
string $connector
Returns
|
public
Laravel\Database\Query
|
#
or_where( string $column, string $operator = null, mixed $value = null )
Add an or where condition to the query.
Add an or where condition to the query.
Parameters
- $column
string $column
- $operator
string $operator
- $value
mixed $value
Returns
|
public
Laravel\Database\Query
|
#
or_where_id( mixed $value )
Add an or where condition for the primary key to the query.
Add an or where condition for the primary key to the query.
Parameters
Returns
|
public
Laravel\Database\Query
|
#
where_in( string $column, array $values, string $connector = 'AND', boolean $not = false )
Add a where in condition to the query.
Add a where in condition to the query.
Parameters
- $column
string $column
- $values
array $values
- $connector
string $connector
- $not
boolean $not
Returns
|
public
Laravel\Database\Query
|
#
or_where_in( string $column, array $values )
Add an or where in condition to the query.
Add an or where in condition to the query.
Parameters
- $column
string $column
- $values
array $values
Returns
|
public
Laravel\Database\Query
|
#
where_not_in( string $column, array $values, string $connector = 'AND' )
Add a where not in condition to the query.
Add a where not in condition to the query.
Parameters
- $column
string $column
- $values
array $values
- $connector
string $connector
Returns
|
public
Laravel\Database\Query
|
#
or_where_not_in( string $column, array $values )
Add an or where not in condition to the query.
Add an or where not in condition to the query.
Parameters
- $column
string $column
- $values
array $values
Returns
|
public
Laravel\Database\Query
|
#
where_between( string $column, mixed $min, mixed $max, string $connector = 'AND', boolean $not = false )
Add a BETWEEN condition to the query
Add a BETWEEN condition to the query
Parameters
- $column
string $column
- $min
mixed $min
- $max
mixed $max
- $connector
string $connector
- $not
boolean $not
Returns
|
public
Laravel\Database\Query
|
#
or_where_between( string $column, mixed $min, mixed $max )
Add a OR BETWEEN condition to the query
Add a OR BETWEEN condition to the query
Parameters
- $column
string $column
- $min
mixed $min
- $max
mixed $max
Returns
|
public
Laravel\Database\Query
|
#
where_not_between( string $column, mixed $min, mixed $max, mixed $connector = 'AND' )
Add a NOT BETWEEN condition to the query
Add a NOT BETWEEN condition to the query
Parameters
- $column
string $column
- $min
mixed $min
- $max
mixed $max
- $connector
Returns
|
public
Laravel\Database\Query
|
#
or_where_not_between( string $column, mixed $min, mixed $max )
Add a OR NOT BETWEEN condition to the query
Add a OR NOT BETWEEN condition to the query
Parameters
- $column
string $column
- $min
mixed $min
- $max
mixed $max
Returns
|
public
Laravel\Database\Query
|
#
where_null( string $column, string $connector = 'AND', boolean $not = false )
Add a where null condition to the query.
Add a where null condition to the query.
Parameters
- $column
string $column
- $connector
string $connector
- $not
boolean $not
Returns
|
public
Laravel\Database\Query
|
#
or_where_null( string $column )
Add an or where null condition to the query.
Add an or where null condition to the query.
Parameters
Returns
|
public
Laravel\Database\Query
|
#
where_not_null( string $column, string $connector = 'AND' )
Add a where not null condition to the query.
Add a where not null condition to the query.
Parameters
- $column
string $column
- $connector
string $connector
Returns
|
public
Laravel\Database\Query
|
#
or_where_not_null( string $column )
Add an or where not null condition to the query.
Add an or where not null condition to the query.
Parameters
Returns
|
public
Laravel\Database\Query
|
#
where_nested( Closure $callback, string $connector = 'AND' )
Add a nested where condition to the query.
Add a nested where condition to the query.
Parameters
- $callback
Closure
$callback
- $connector
string $connector
Returns
|
private
Laravel\Database\Query
|
#
dynamic_where( string $method, array $parameters )
Add dynamic where conditions to the query.
Add dynamic where conditions to the query.
Parameters
- $method
string $method
- $parameters
array $parameters
Returns
|
public
Laravel\Database\Query
|
#
group_by( string $column )
Add a grouping to the query.
Add a grouping to the query.
Parameters
Returns
|
public
|
#
having( string $column, string $operator, mixed $value )
Add a having to the query.
Add a having to the query.
Parameters
- $column
string $column
- $operator
string $operator
- $value
mixed $value
|
public
Laravel\Database\Query
|
#
order_by( string $column, string $direction = 'asc' )
Add an ordering to the query.
Add an ordering to the query.
Parameters
- $column
string $column
- $direction
string $direction
Returns
|
public
Laravel\Database\Query
|
#
skip( integer $value )
Set the query offset.
Parameters
Returns
|
public
Laravel\Database\Query
|
#
take( integer $value )
Set the query limit.
Parameters
Returns
|
public
Laravel\Database\Query
|
#
for_page( integer $page, integer $per_page )
Set the query limit and offset for a given page.
Set the query limit and offset for a given page.
Parameters
- $page
integer $page
- $per_page
integer $per_page
Returns
|
public
object
|
#
find( integer $id, array $columns = array('*') )
Find a record by the primary key.
Find a record by the primary key.
Parameters
- $id
integer $id
- $columns
array $columns
Returns
object
|
public
mixed
|
#
only( string $column )
Execute the query as a SELECT statement and return a single column.
Execute the query as a SELECT statement and return a single column.
Parameters
Returns
mixed
|
public
mixed
|
#
first( array $columns = array('*') )
Execute the query as a SELECT statement and return the first result.
Execute the query as a SELECT statement and return the first result.
Parameters
Returns
mixed
|
public
array
|
#
lists( string $column, string $key = null )
Get an array with the values of a given column.
Get an array with the values of a given column.
Parameters
- $column
string $column
- $key
string $key
Returns
array
|
public
array
|
#
get( array $columns = array('*') )
Execute the query as a SELECT statement.
Execute the query as a SELECT statement.
Parameters
Returns
array
|
public
mixed
|
#
aggregate( string $aggregator, array $columns )
Get an aggregate value.
Parameters
- $aggregator
string $aggregator
- $columns
array $columns
Returns
mixed
|
public
Laravel\Paginator
|
#
paginate( integer $per_page = 20, array $columns = array('*') )
Get the paginated query results as a Paginator instance.
Get the paginated query results as a Paginator instance.
Parameters
- $per_page
integer $per_page
- $columns
array $columns
Returns
|
public
boolean
|
#
insert( array $values )
Insert an array of values into the database table.
Insert an array of values into the database table.
Parameters
Returns
boolean
|
public
mixed
|
#
insert_get_id( array $values, string $column = 'id' )
Insert an array of values into the database table and return the key.
Insert an array of values into the database table and return the key.
Parameters
- $values
array $values
- $column
string $column
Returns
mixed
|
public
integer
|
#
increment( string $column, integer $amount = 1 )
Increment the value of a column by a given amount.
Increment the value of a column by a given amount.
Parameters
- $column
string $column
- $amount
integer $amount
Returns
integer
|
public
integer
|
#
decrement( string $column, integer $amount = 1 )
Decrement the value of a column by a given amount.
Decrement the value of a column by a given amount.
Parameters
- $column
string $column
- $amount
integer $amount
Returns
integer
|
protected
integer
|
#
adjust( string $column, integer $amount, string $operator )
Adjust the value of a column up or down by a given amount.
Adjust the value of a column up or down by a given amount.
Parameters
- $column
string $column
- $amount
integer $amount
- $operator
string $operator
Returns
integer
|
public
integer
|
#
update( array $values )
Update an array of values in the database table.
Update an array of values in the database table.
Parameters
Returns
integer
|
public
integer
|
#
delete( integer $id = null )
Execute the query as a DELETE statement.
Execute the query as a DELETE statement.
Optionally, an ID may be passed to the method do delete a specific row.
Parameters
Returns
integer
|
public
|
#
__call( mixed $method, mixed $parameters )
Magic Method for handling dynamic functions.
Magic Method for handling dynamic functions.
This method handles calls to aggregates as well as dynamic where clauses.
|