DatabaseRule
trait DatabaseRule (View source)
Properties
| protected string | $table | The table to run the query against. | |
| protected string | $column | The column to check on. | |
| protected array | $wheres | The extra where clauses for the query. | |
| protected array | $using | The array of custom query callbacks. | 
Methods
| void |  __construct(string $table, string $column = 'NULL')  Create a new rule instance.  |  |
| $this |  where(string|Closure $column, array|string|null $value = null)  Set a "where" constraint on the query.  |  |
| $this |  whereNot(string $column, array|string $value)  Set a "where not" constraint on the query.  |  |
| $this |  whereNull(string $column)  Set a "where null" constraint on the query.  |  |
| $this |  whereNotNull(string $column)  Set a "where not null" constraint on the query.  |  |
| $this |  whereIn(string $column, array $values)  Set a "where in" constraint on the query.  |  |
| $this |  whereNotIn(string $column, array $values)  Set a "where not in" constraint on the query.  |  |
| $this |  using(Closure $callback)  Register a custom query callback.  |  |
| array |  queryCallbacks()  Get the custom query callbacks for the rule.  |  |
| string |  formatWheres()  Format the where clauses.  |  
Details
void __construct(string $table, string $column = 'NULL')
Create a new rule instance.
$this where(string|Closure $column, array|string|null $value = null)
Set a "where" constraint on the query.
$this whereNot(string $column, array|string $value)
Set a "where not" constraint on the query.
$this whereNull(string $column)
Set a "where null" constraint on the query.
$this whereNotNull(string $column)
Set a "where not null" constraint on the query.
$this whereIn(string $column, array $values)
Set a "where in" constraint on the query.
$this whereNotIn(string $column, array $values)
Set a "where not in" constraint on the query.
$this using(Closure $callback)
Register a custom query callback.
array queryCallbacks()
Get the custom query callbacks for the rule.
protected string formatWheres()
Format the where clauses.
    © Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
    https://laravel.com/api/5.8/Illuminate/Validation/Rules/DatabaseRule.html