trait
Illuminate
/
Validation
/
Rules
/
DatabaseRule
You are viewing an older version of the documentation. For the latest, please visit master documentation.
DatabaseRule
Properties
protected
$table string
The table to run the query against.
Default: null
protected
$column string
The column to check on.
Default: null
protected
$wheres array
The extra where clauses for the query.
Default: []
protected
$using array
The array of custom query callbacks.
Default: []
Methods
public
__construct ( $table , $column ) : void
Create a new rule instance.
Parameters
- $table string
- $column string
public
resolveTableName ( $table ) : string
Resolves the name of the table from the given string.
Parameters
- $table string
public
where ( $column , $value ) : $this
Set a "where" constraint on the query.
Parameters
- $column Closure |string
- $value array|string|int|null
public
whereNot ( $column , $value ) : $this
Set a "where not" constraint on the query.
Parameters
- $column string
- $value array|string
public
whereNull ( $column ) : $this
Set a "where null" constraint on the query.
Parameters
- $column string
public
whereNotNull ( $column ) : $this
Set a "where not null" constraint on the query.
Parameters
- $column string
public
whereIn ( $column , array $values ) : $this
Set a "where in" constraint on the query.
Parameters
- $column string
- $values array
public
whereNotIn ( $column , array $values ) : $this
Set a "where not in" constraint on the query.
Parameters
- $column string
- $values array
public
using ( Closure $callback ) : $this
Register a custom query callback.
Parameters
- $callback Closure
public
queryCallbacks ( ) : array
Get the custom query callbacks for the rule.
protected
formatWheres ( ) : string
Format the where clauses.