class Builder extends Builder

Methods

$this
search(array|string $query, array $columns = null, boolean $fulltext = true, float $threshold = null)

Search through any columns on current table or any defined relations and return results ordered by search relevance.

string
getLikeOperator()

Get driver-specific case insensitive like operator.

void
prefixColumnsForJoin()

Prefix selected columns with table name in order to avoid collisions.

$this
joinRelations(array|string $relations, string $type = 'inner')

Join related tables.

$this
leftJoinRelations(array|string $relations)

Left join related tables.

$this
rightJoinRelations(array|string $relations)

Right join related tables.

static 
setParserFactory(ParserFactory $factory)

Set search query parser factory instance.

static 
setJoinerFactory(JoinerFactory $factory)

Set the relations joiner factory instance.

mixed
callParent(string $method, array $args)

Call base Eloquent method.

Collection
get(array $columns = array('*'))

Execute the query as a "select" statement.

$this
select(array $columns = array('*'))

Set the columns to be selected.

$this
where(mixed $column, string $operator = null, mixed $value = null, string $boolean = 'and')

Add where constraint to the query.

$this
orWhere(string $column, string $operator = null, mixed $value = null)

Add an "or where" clause to the query.

$this
whereBetween(string $column, array $values, string $boolean = 'and', boolean $not = false)

Add a where between statement to the query.

$this
orWhereBetween(string $column, array $values)

Add an or where between statement to the query.

$this
whereNotBetween(string $column, array $values, string $boolean = 'and')

Add a where not between statement to the query.

$this
orWhereNotBetween(string $column, array $values)

Add an or where not between statement to the query.

$this
whereIn(string $column, mixed $values, string $boolean = 'and', bool $not = false)

Add a "where in" clause to the query.

$this
orWhereIn(string $column, mixed $values)

Add an "or where in" clause to the query.

$this
whereNotIn(string $column, mixed $values, string $boolean = 'and')

Add a "where not in" clause to the query.

$this
orWhereNotIn(string $column, mixed $values)

Add an "or where not in" clause to the query.

$this
whereNull(string $column, string $boolean = 'and', bool $not = false)

Add a "where null" clause to the query.

$this
orWhereNull(string $column)

Add an "or where null" clause to the query.

$this
whereNotNull(string $column, string $boolean = 'and')

Add a "where not null" clause to the query.

$this
orWhereNotNull(string $column)

Add an "or where not null" clause to the query.

$this
whereDate(string $column, string $operator, int $value, string $boolean = 'and')

Add a "where date" statement to the query.

$this
whereDay(string $column, string $operator, int $value, string $boolean = 'and')

Add a "where day" statement to the query.

$this
whereMonth(string $column, string $operator, int $value, string $boolean = 'and')

Add a "where month" statement to the query.

$this
whereYear(string $column, string $operator, int $value, string $boolean = 'and')

Add a "where year" statement to the query.

$this
whereExists(Closure $callback, string $boolean = 'and', bool $not = false)

Add an exists clause to the query.

$this
orderBy(string $column, string $direction = 'asc')

Add an "order by" clause to the query.

$this
latest(string $column = 'created_at')

Add an "order by" clause for a timestamp to the query.

$this
oldest(string $column = 'created_at')

Add an "order by" clause for a timestamp to the query.

mixed
pluck(string $column)

Pluck a single column from the database.

mixed
aggregate(string $function, array $columns = array('*'))

Execute an aggregate function on the database.

mixed
min(string $column)

Retrieve the minimum value of a given column.

mixed
max(string $column)

Retrieve the maximum value of a given column.

mixed
avg(string $column)

Retrieve the average of the values of a given column.

mixed
sum(string $column)

Retrieve the sum of the values of a given column.

int
count(string $columns = '*')

Retrieve the "count" result of the query.

array
lists(string $column, string $key = null)

Get an array with the values of a given column.

newQuery()

Get a new instance of the Eloquence query builder.

Details

Search through any columns on current table or any defined relations and return results ordered by search relevance.

Parameters

array|string $query
array $columns
boolean $fulltext
float $threshold

Return Value

$this

at line 432
string getLikeOperator()

Get driver-specific case insensitive like operator.

Return Value

string

at line 488
void prefixColumnsForJoin()

Prefix selected columns with table name in order to avoid collisions.

Return Value

void

at line 510
$this joinRelations(array|string $relations, string $type = 'inner')

Join related tables.

Parameters

array|string $relations
string $type

Return Value

$this

at line 533
$this leftJoinRelations(array|string $relations)

Left join related tables.

Parameters

array|string $relations

Return Value

$this

at line 546
$this rightJoinRelations(array|string $relations)

Right join related tables.

Parameters

array|string $relations

Return Value

$this

at line 558
static setParserFactory(ParserFactory $factory)

Set search query parser factory instance.

Parameters

ParserFactory $factory

at line 568
static setJoinerFactory(JoinerFactory $factory)

Set the relations joiner factory instance.

Parameters

JoinerFactory $factory

at line 586
mixed callParent(string $method, array $args)

Call base Eloquent method.

Parameters

string $method
array $args

Return Value

mixed

at line 644
Collection get(array $columns = array('*'))

Execute the query as a "select" statement.

Parameters

array $columns

Return Value

Collection

at line 659
$this select(array $columns = array('*'))

Set the columns to be selected.

Parameters

array $columns

Return Value

$this

at line 675
$this where(mixed $column, string $operator = null, mixed $value = null, string $boolean = 'and')

Add where constraint to the query.

Parameters

mixed $column
string $operator
mixed $value
string $boolean

Return Value

$this

at line 694
$this orWhere(string $column, string $operator = null, mixed $value = null)

Add an "or where" clause to the query.

Parameters

string $column
string $operator
mixed $value

Return Value

$this

at line 710
$this whereBetween(string $column, array $values, string $boolean = 'and', boolean $not = false)

Add a where between statement to the query.

Parameters

string $column
array $values
string $boolean
boolean $not

Return Value

$this

Exceptions

InvalidArgumentException

at line 728
$this orWhereBetween(string $column, array $values)

Add an or where between statement to the query.

Parameters

string $column
array $values

Return Value

$this

at line 741
$this whereNotBetween(string $column, array $values, string $boolean = 'and')

Add a where not between statement to the query.

Parameters

string $column
array $values
string $boolean

Return Value

$this

at line 753
$this orWhereNotBetween(string $column, array $values)

Add an or where not between statement to the query.

Parameters

string $column
array $values

Return Value

$this

at line 768
$this whereIn(string $column, mixed $values, string $boolean = 'and', bool $not = false)

Add a "where in" clause to the query.

Parameters

string $column
mixed $values
string $boolean
bool $not

Return Value

$this

at line 780
$this orWhereIn(string $column, mixed $values)

Add an "or where in" clause to the query.

Parameters

string $column
mixed $values

Return Value

$this

at line 793
$this whereNotIn(string $column, mixed $values, string $boolean = 'and')

Add a "where not in" clause to the query.

Parameters

string $column
mixed $values
string $boolean

Return Value

$this

at line 805
$this orWhereNotIn(string $column, mixed $values)

Add an "or where not in" clause to the query.

Parameters

string $column
mixed $values

Return Value

$this

at line 818
$this whereNull(string $column, string $boolean = 'and', bool $not = false)

Add a "where null" clause to the query.

Parameters

string $column
string $boolean
bool $not

Return Value

$this

at line 829
$this orWhereNull(string $column)

Add an "or where null" clause to the query.

Parameters

string $column

Return Value

$this

at line 841
$this whereNotNull(string $column, string $boolean = 'and')

Add a "where not null" clause to the query.

Parameters

string $column
string $boolean

Return Value

$this

at line 852
$this orWhereNotNull(string $column)

Add an "or where not null" clause to the query.

Parameters

string $column

Return Value

$this

at line 881
$this whereDate(string $column, string $operator, int $value, string $boolean = 'and')

Add a "where date" statement to the query.

Parameters

string $column
string $operator
int $value
string $boolean

Return Value

$this

at line 895
$this whereDay(string $column, string $operator, int $value, string $boolean = 'and')

Add a "where day" statement to the query.

Parameters

string $column
string $operator
int $value
string $boolean

Return Value

$this

at line 909
$this whereMonth(string $column, string $operator, int $value, string $boolean = 'and')

Add a "where month" statement to the query.

Parameters

string $column
string $operator
int $value
string $boolean

Return Value

$this

at line 923
$this whereYear(string $column, string $operator, int $value, string $boolean = 'and')

Add a "where year" statement to the query.

Parameters

string $column
string $operator
int $value
string $boolean

Return Value

$this

at line 936
$this whereExists(Closure $callback, string $boolean = 'and', bool $not = false)

Add an exists clause to the query.

Parameters

Closure $callback
string $boolean
bool $not

Return Value

$this

at line 960
$this orderBy(string $column, string $direction = 'asc')

Add an "order by" clause to the query.

Parameters

string $column
string $direction

Return Value

$this

at line 971
$this latest(string $column = 'created_at')

Add an "order by" clause for a timestamp to the query.

Parameters

string $column

Return Value

$this

at line 982
$this oldest(string $column = 'created_at')

Add an "order by" clause for a timestamp to the query.

Parameters

string $column

Return Value

$this

at line 993
mixed pluck(string $column)

Pluck a single column from the database.

Parameters

string $column

Return Value

mixed

at line 1005
mixed aggregate(string $function, array $columns = array('*'))

Execute an aggregate function on the database.

Parameters

string $function
array $columns

Return Value

mixed

at line 1018
mixed min(string $column)

Retrieve the minimum value of a given column.

Parameters

string $column

Return Value

mixed

at line 1029
mixed max(string $column)

Retrieve the maximum value of a given column.

Parameters

string $column

Return Value

mixed

at line 1040
mixed avg(string $column)

Retrieve the average of the values of a given column.

Parameters

string $column

Return Value

mixed

at line 1051
mixed sum(string $column)

Retrieve the sum of the values of a given column.

Parameters

string $column

Return Value

mixed

at line 1062
int count(string $columns = '*')

Retrieve the "count" result of the query.

Parameters

string $columns

Return Value

int

at line 1074
array lists(string $column, string $key = null)

Get an array with the values of a given column.

Parameters

string $column
string $key

Return Value

array

at line 1084
Builder newQuery()

Get a new instance of the Eloquence query builder.

Return Value

Builder