Validator
extends Validator
in package
Class Validator.
Table of Contents
- exist() : bool
- Validates value exists in database table.
- existMany() : bool
- Validates many values exists in database table.
- notUnique() : bool
- Validates database table not unique value.
- unique() : bool
- Validates database table unique value.
Methods
exist()
Validates value exists in database table.
public
static exist(string $field, array<string, mixed> $data, string $tableColumn[, string $connection = 'default' ]) : bool
Parameters
- $field : string
- $data : array<string, mixed>
- $tableColumn : string
- $connection : string = 'default'
Tags
Return values
bool —existMany()
Validates many values exists in database table.
public
static existMany(string $field, array<string, mixed> $data, string $tableColumn[, string $connection = 'default' ]) : bool
Parameters
- $field : string
- $data : array<string, mixed>
- $tableColumn : string
- $connection : string = 'default'
Tags
Return values
bool —notUnique()
Validates database table not unique value.
public
static notUnique(string $field, array<string, mixed> $data, string $tableColumn[, string $ignoreColumn = '' ][, int|string $ignoreValue = '' ][, string $connection = 'default' ]) : bool
Parameters
- $field : string
- $data : array<string, mixed>
- $tableColumn : string
- $ignoreColumn : string = ''
- $ignoreValue : int|string = ''
- $connection : string = 'default'
Return values
bool —unique()
Validates database table unique value.
public
static unique(string $field, array<string, mixed> $data, string $tableColumn[, string $ignoreColumn = '' ][, int|string $ignoreValue = '' ][, string $connection = 'default' ]) : bool
You can ignore rows where a column has a certain value. Useful when updating a row in the database.
Parameters
- $field : string
- $data : array<string, mixed>
- $tableColumn : string
- $ignoreColumn : string = ''
- $ignoreValue : int|string = ''
- $connection : string = 'default'