class Exists

Properties

protected string $table

The table to run the query against.

protected string $column

The column to check for existence on.

protected array $wheres

There extra where clauses for the query.

protected Closure|null $using

The custom query callback.

Methods

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

Create a new exists rule instance.

$this
where(string $column, string $value = null)

Set a "where" constraint on the query.

$this
whereNot(string $column, 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
using(Closure $callback)

Register a custom query callback.

string
formatWheres()

Format the where clauses.

array
queryCallbacks()

Get the custom query callbacks for the rule.

string
__toString()

Convert the rule to a validation string.

Details

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

Create a new exists rule instance.

Parameters

string $table
string $column

Return Value

void

at line 57
$this where(string $column, string $value = null)

Set a "where" constraint on the query.

Parameters

string $column
string $value

Return Value

$this

at line 75
$this whereNot(string $column, string $value)

Set a "where not" constraint on the query.

Parameters

string $column
string $value

Return Value

$this

at line 86
$this whereNull(string $column)

Set a "where null" constraint on the query.

Parameters

string $column

Return Value

$this

at line 97
$this whereNotNull(string $column)

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

Parameters

string $column

Return Value

$this

at line 108
$this using(Closure $callback)

Register a custom query callback.

Parameters

Closure $callback

Return Value

$this

at line 120
protected string formatWheres()

Format the where clauses.

Return Value

string

at line 132
array queryCallbacks()

Get the custom query callbacks for the rule.

Return Value

array

at line 142
string __toString()

Convert the rule to a validation string.

Return Value

string