Exists

class Exists (View source)

Traits

DatabaseRule

Properties

protected string $table The table to run the query against. from DatabaseRule
protected string $column The column to check on. from DatabaseRule
protected array $wheres The extra where clauses for the query. from DatabaseRule
protected array $using The array of custom query callbacks. from DatabaseRule

Methods

void __construct(string $table, string $column = 'NULL')

Create a new rule instance.

from DatabaseRule
$this where(string|Closure $column, array|string|null $value = null)

Set a "where" constraint on the query.

from DatabaseRule
$this whereNot(string $column, array|string $value)

Set a "where not" constraint on the query.

from DatabaseRule
$this whereNull(string $column)

Set a "where null" constraint on the query.

from DatabaseRule
$this whereNotNull(string $column)

Set a "where not null" constraint on the query.

from DatabaseRule
$this whereIn(string $column, array $values)

Set a "where in" constraint on the query.

from DatabaseRule
$this whereNotIn(string $column, array $values)

Set a "where not in" constraint on the query.

from DatabaseRule
$this using(Closure $callback)

Register a custom query callback.

from DatabaseRule
array queryCallbacks()

Get the custom query callbacks for the rule.

from DatabaseRule
string formatWheres()

Format the where clauses.

from DatabaseRule
string __toString()

Convert the rule to a validation string.

Details

void __construct(string $table, string $column = 'NULL')

Create a new rule instance.

Parameters

string $table
string $column

Return Value

void

$this where(string|Closure $column, array|string|null $value = null)

Set a "where" constraint on the query.

Parameters

string|Closure $column
array|string|null $value

Return Value

$this

$this whereNot(string $column, array|string $value)

Set a "where not" constraint on the query.

Parameters

string $column
array|string $value

Return Value

$this

$this whereNull(string $column)

Set a "where null" constraint on the query.

Parameters

string $column

Return Value

$this

$this whereNotNull(string $column)

Set a "where not null" constraint on the query.

Parameters

string $column

Return Value

$this

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

Set a "where in" constraint on the query.

Parameters

string $column
array $values

Return Value

$this

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

Set a "where not in" constraint on the query.

Parameters

string $column
array $values

Return Value

$this

$this using(Closure $callback)

Register a custom query callback.

Parameters

Closure $callback

Return Value

$this

array queryCallbacks()

Get the custom query callbacks for the rule.

Return Value

array

protected string formatWheres()

Format the where clauses.

Return Value

string

string __toString()

Convert the rule to a validation string.

Return Value

string

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.7/Illuminate/Validation/Rules/Exists.html