Validator
Trait Validator.
Table of Contents
- alpha() : static
- Validates alphabetic characters.
- alphaNumber() : static
- Validates a number or alphabetic characters.
- array() : static
- Validates array.
- base64() : static
- Validates a base64 string.
- between() : static
- Validate field between min and max values.
- bool() : static
- Validates boolean.
- datetime() : static
- Validates a datetime format.
- email() : static
- Validates a email.
- equals() : static
- Validate field has value equals other field.
- float() : static
- Validates float.
- greater() : static
- Validates is greater than.
- greaterOrEqual() : static
- Validates is greater than or equal to.
- hex() : static
- Validates a hexadecimal string.
- hexColor() : static
- Validates a hexadecimal color.
- in() : static
- Validate field is in list.
- int() : static
- Validates integer.
- ip() : static
- Validates an IP.
- isset() : static
- Validates field is set.
- json() : static
- Validates a JSON string.
- latin() : static
- Validates a latin text.
- length() : static
- Validates exact length.
- less() : static
- Validates is less than.
- lessOrEqual() : static
- Validates is less than or equal to.
- maxLength() : static
- Validates max length.
- md5() : static
- Validates a md5 hash.
- minLength() : static
- Validates min length.
- notBetween() : static
- Validate field not between min and max values.
- notEquals() : static
- Validate field has not value equals other field.
- notIn() : static
- Validate field is not in list.
- notRegex() : static
- Validates a Regex no matching pattern.
- number() : static
- Validates a number.
- object() : static
- Validates object.
- regex() : static
- Validates a Regex pattern.
- required() : static
- Validates required value.
- slug() : static
- Validates slug.
- specialChar() : static
- Validates special characters.
- string() : static
- Validates string.
- timezone() : static
- Validates a timezone.
- url() : static
- Validates an URL.
- uuid() : static
- Validates a UUID.
Methods
alpha()
Validates alphabetic characters.
public
alpha() : static
Return values
static —alphaNumber()
Validates a number or alphabetic characters.
public
alphaNumber() : static
Return values
static —array()
Validates array.
public
array() : static
Tags
Return values
static —base64()
Validates a base64 string.
public
base64() : static
Return values
static —between()
Validate field between min and max values.
public
between(int|string $min, int|string $max) : static
Parameters
- $min : int|string
- $max : int|string
Return values
static —bool()
Validates boolean.
public
bool() : static
Tags
Return values
static —datetime()
Validates a datetime format.
public
datetime([string $format = 'Y-m-d H:i:s' ]) : static
Parameters
- $format : string = 'Y-m-d H:i:s'
Return values
static —email()
Validates a email.
public
email() : static
Return values
static —equals()
Validate field has value equals other field.
public
equals(string $equalsField) : static
Parameters
- $equalsField : string
Return values
static —float()
Validates float.
public
float() : static
Tags
Return values
static —greater()
Validates is greater than.
public
greater(int|string $greaterThan) : static
Parameters
- $greaterThan : int|string
Return values
static —greaterOrEqual()
Validates is greater than or equal to.
public
greaterOrEqual(int|string $greaterThanOrEqualTo) : static
Parameters
- $greaterThanOrEqualTo : int|string
Return values
static —hex()
Validates a hexadecimal string.
public
hex() : static
Return values
static —hexColor()
Validates a hexadecimal color.
public
hexColor() : static
Return values
static —in()
Validate field is in list.
public
in(string $in, string ...$others) : static
Parameters
- $in : string
- $others : string
Return values
static —int()
Validates integer.
public
int() : static
Tags
Return values
static —ip()
Validates an IP.
public
ip(int $version) : static
Parameters
- $version : int
-
4, 6 or 0 to both
Return values
static —isset()
Validates field is set.
public
isset() : static
Return values
static —json()
Validates a JSON string.
public
json() : static
Return values
static —latin()
Validates a latin text.
public
latin() : static
Return values
static —length()
Validates exact length.
public
length(int $length) : static
Parameters
- $length : int
Return values
static —less()
Validates is less than.
public
less(int|string $lessThan) : static
Parameters
- $lessThan : int|string
Return values
static —lessOrEqual()
Validates is less than or equal to.
public
lessOrEqual(int|string $lessThanOrEqualTo) : static
Parameters
- $lessThanOrEqualTo : int|string
Return values
static —maxLength()
Validates max length.
public
maxLength(int $maxLength) : static
Parameters
- $maxLength : int
Return values
static —md5()
Validates a md5 hash.
public
md5() : static
Return values
static —minLength()
Validates min length.
public
minLength(int $minLength) : static
Parameters
- $minLength : int
Return values
static —notBetween()
Validate field not between min and max values.
public
notBetween(int|string $min, int|string $max) : static
Parameters
- $min : int|string
- $max : int|string
Return values
static —notEquals()
Validate field has not value equals other field.
public
notEquals(string $diffField) : static
Parameters
- $diffField : string
Return values
static —notIn()
Validate field is not in list.
public
notIn(string $notIn, string ...$others) : static
Parameters
- $notIn : string
- $others : string
Return values
static —notRegex()
Validates a Regex no matching pattern.
public
notRegex(string $pattern) : static
Parameters
- $pattern : string
Return values
static —number()
Validates a number.
public
number() : static
Return values
static —object()
Validates object.
public
object() : static
Tags
Return values
static —regex()
Validates a Regex pattern.
public
regex(string $pattern) : static
Parameters
- $pattern : string
Return values
static —required()
Validates required value.
public
required() : static
Return values
static —slug()
Validates slug.
public
slug() : static
Tags
Return values
static —specialChar()
Validates special characters.
public
specialChar([int $quantity = 1 ][, string $characters = '!"#$%&'()*+,-./:;=<>?@[\]^_`{|}~' ]) : static
Parameters
- $quantity : int = 1
- $characters : string = '!"#$%&'()*+,-./:;=<>?@[\]^_`{|}~'
Tags
Return values
static —string()
Validates string.
public
string() : static
Tags
Return values
static —timezone()
Validates a timezone.
public
timezone() : static
Return values
static —url()
Validates an URL.
public
url() : static
Return values
static —uuid()
Validates a UUID.
public
uuid() : static