class Validator (View source)

Traits

Properties

protected bool $fails

The Fails flag

protected string $last_message

The last name

protected array $errors

The errors list

protected array $inputs

The validation DATA

protected array $messages

The user messages

protected array $rules

Define the valid rule list

Methods

void
compileExists(string $key, string $masque)

Compile Exists Rule

void
compileNotExists(string $key, string $masque)

Compile Not Exists Rule

void
compileUnique(string $key, string $masque)

Compile Unique Rule

void
compileDate(string $key, string $masque)

Compile Date Rule

void
compileDateTime(string $key, string $masque)

Compile Date Time Rule

void
compileEmail(string $key, string $masque)

Compile Email Rule

void
compileNumber(string $key, string $masque)

Compile Number Rule

void
compileInt(string $key, string $masque)

Compile Int Rule

void
compileFloat(string $key, string $masque)

Compile Float Rule

void
compileRequired(string $key, string $masque)

Compile Required Rule

void
compileEmpty(string $key, string $masque)

Compile Empty Rule

void
compileAlphaNum(string $key, string $masque)

Compile Alphanum Rule

void
compileIn(string $key, string $masque)

Compile In Rule

void
compileSize(string $key, string $masque)

Compile Size Rule

void
compileLower(string $key, string $masque)

Compile Lower Rule

void
compileUpper(string $key, string $masque)

Compile Upper Rule

void
compileAlpha(string $key, string $masque)

Compile Alpha Rule

void
compileMin(string $key, string $masque)

Compile Min Mask

void
compileMax(string $key, string $masque)

Compile Max Rule

void
compileSame(string $key, string $masque)

Compile Some Rule

void
compileRegex(string $key, string $masque)

Compile Regex Rule

void
__construct()

Validator constructor

static Validate
make(array $inputs, array $rules, array $messages = [])

Any possible markers.

setCustomMessages(array $messages)

Set the user custom message

validate(array $inputs, array $rules)

Make validation

Details

protected void compileExists(string $key, string $masque)

Compile Exists Rule

[exists:table,column] Check that the contents of a table field exist

Parameters

string $key
string $masque

Return Value

void

protected void compileNotExists(string $key, string $masque)

Compile Not Exists Rule

[!exists:table,column] Checks that the contents of the field of a table do not exist

Parameters

string $key
string $masque

Return Value

void

protected void compileUnique(string $key, string $masque)

Compile Unique Rule

[unique:table,column] Check that the contents of the field of a table is a single value

Parameters

string $key
string $masque

Return Value

void

protected void compileDate(string $key, string $masque)

Compile Date Rule

[date] Check that the field's content is a valid date

Parameters

string $key
string $masque

Return Value

void

protected void compileDateTime(string $key, string $masque)

Compile Date Time Rule

[datetime] Check that the contents of the field is a valid date time

Parameters

string $key
string $masque

Return Value

void

protected void compileEmail(string $key, string $masque)

Compile Email Rule

[email] Check that the content of the field is an email

Parameters

string $key
string $masque

Return Value

void

protected void compileNumber(string $key, string $masque)

Compile Number Rule

[number] Check that the contents of the field is a number

Parameters

string $key
string $masque

Return Value

void

protected void compileInt(string $key, string $masque)

Compile Int Rule

[int] Check that the contents of the field is an integer number

Parameters

string $key
string $masque

Return Value

void

protected void compileFloat(string $key, string $masque)

Compile Float Rule

[float] Check that the field content is a float number

Parameters

string $key
string $masque

Return Value

void

protected void compileRequired(string $key, string $masque)

Compile Required Rule

Parameters

string $key
string $masque

Return Value

void

protected void compileEmpty(string $key, string $masque)

Compile Empty Rule

Parameters

string $key
string $masque

Return Value

void

protected void compileAlphaNum(string $key, string $masque)

Compile Alphanum Rule

[alphanum] Check that the field content is an alphanumeric string

Parameters

string $key
string $masque

Return Value

void

protected void compileIn(string $key, string $masque)

Compile In Rule

[in:(value, ...)] Check that the contents of the field are equal to the defined value

Parameters

string $key
string $masque

Return Value

void

protected void compileSize(string $key, string $masque)

Compile Size Rule

[size:value] Check that the contents of the field is a number of character equal to the defined value

Parameters

string $key
string $masque

Return Value

void

protected void compileLower(string $key, string $masque)

Compile Lower Rule

[lower] Check that the content of the field is a string in miniscule

Parameters

string $key
string $masque

Return Value

void

protected void compileUpper(string $key, string $masque)

Compile Upper Rule

[upper] Check that the contents of the field is a string in uppercase

Parameters

string $key
string $masque

Return Value

void

protected void compileAlpha(string $key, string $masque)

Compile Alpha Rule

[alpha] Check that the field content is an alpha

Parameters

string $key
string $masque

Return Value

void

protected void compileMin(string $key, string $masque)

Compile Min Mask

[min:value] Check that the content of the field is a number of minimal character following the defined value

Parameters

string $key
string $masque

Return Value

void

protected void compileMax(string $key, string $masque)

Compile Max Rule

[max:value] Check that the content of the field is a number of maximum character following the defined value

Parameters

string $key
string $masque

Return Value

void

protected void compileSame(string $key, string $masque)

Compile Some Rule

[same:value] Check that the field contents are equal to the mask value

Parameters

string $key
string $masque

Return Value

void

protected void compileRegex(string $key, string $masque)

Compile Regex Rule

[regex] Check that the contents of the field with a regular expression

Parameters

string $key
string $masque

Return Value

void

void __construct()

Validator constructor

Return Value

void

static Validate make(array $inputs, array $rules, array $messages = [])

Any possible markers.

Parameters

array $inputs
array $rules
array $messages

Return Value

Validate

setCustomMessages(array $messages)

Set the user custom message

Parameters

array $messages

Validate validate(array $inputs, array $rules)

Make validation

Parameters

array $inputs
array $rules

Return Value

Validate