Properties

$attributes

$attributes : array

The array being validated.

Type

array

Tags

None found

$errors

$errors : \Laravel\Messages

The post-validation error messages.

Type

LaravelMessages

Tags

None found

$rules

$rules : array

The validation rules.

Type

array

Tags

None found

$messages

$messages : array

The validation messages.

Type

array

Tags

None found

$db

$db : \Laravel\Database\Connection

The database connection that should be used by the validator.

Type

LaravelDatabaseConnection

Tags

None found

$bundle

$bundle : string

The bundle for which the validation is being run.

Type

string

Tags

None found

$language

$language : string

The language that should be used when retrieving error messages.

Type

string

Tags

None found

$size_rules

$size_rules : array

The size related validation rules.

Type

array

Tags

None found

$numeric_rules

$numeric_rules : array

The numeric related validation rules.

Type

array

Tags

None found

$validators

$validators : array

The registered custom validators.

Type

array

Tags

None found

Methods

__construct()

__construct(mixed  $attributes, array  $rules, array  $messages = array()) : void

Create a new validator instance.

Parameters

mixed $attributes
array $rules
array $messages

Tags

None found

make()

make(array  $attributes, array  $rules, array  $messages = array()) : \Laravel\Validator

Create a new validator instance.

Parameters

array $attributes
array $rules
array $messages

Returns

LaravelValidator

static

Tags

None found

register()

register(string  $name, \Closure  $validator) : void

Register a custom validator.

Parameters

string $name
Closure $validator

static

Tags

None found

passes()

passes() : boolean

Validate the target array using the specified validation rules.

Returns

boolean

Tags

None found

fails()

fails() : boolean

Validate the target array using the specified validation rules.

Returns

boolean

Tags

None found

invalid()

invalid() : boolean

Validate the target array using the specified validation rules.

Returns

boolean

Tags

None found

valid()

valid() : boolean

Validate the target array using the specified validation rules.

Returns

boolean

Tags

None found

bundle()

bundle(string  $bundle) : \Laravel\Validator

Set the bundle that the validator is running for.

The bundle determines which bundle the language lines will be loaded from.

Parameters

string $bundle

Returns

LaravelValidator

Tags

None found

speaks()

speaks(string  $language) : \Laravel\Validator

Set the language that should be used when retrieving error messages.

Parameters

string $language

Returns

LaravelValidator

Tags

None found

connection()

connection(\Laravel\Database\Connection  $connection) : \Laravel\Validator

Set the database connection that should be used by the validator.

Parameters

LaravelDatabaseConnection $connection

Returns

LaravelValidator

Tags

None found

__call()

__call(  $method,   $parameters) 

Dynamically handle calls to custom registered validators.

Parameters

$method
$parameters

Tags

None found

check()

check(string  $attribute, string  $rule) : void

Evaluate an attribute against a validation rule.

Parameters

string $attribute
string $rule

Tags

None found

validatable()

validatable(string  $rule, string  $attribute, mixed  $value) : boolean

Determine if an attribute is validatable.

To be considered validatable, the attribute must either exist, or the rule being checked must implicitly validate "required", such as the "required" rule or the "accepted" rule.

Parameters

string $rule
string $attribute
mixed $value

Returns

boolean

Tags

None found

implicit()

implicit(string  $rule) : boolean

Determine if a given rule implies that the attribute is required.

Parameters

string $rule

Returns

boolean

Tags

None found

error()

error(string  $attribute, string  $rule, array  $parameters) : void

Add an error message to the validator's collection of messages.

Parameters

string $attribute
string $rule
array $parameters

Tags

None found

validate_required()

validate_required(string  $attribute, mixed  $value) : boolean

Validate that a required attribute exists in the attributes array.

Parameters

string $attribute
mixed $value

Returns

boolean

Tags

None found

validate_required_with()

validate_required_with(string  $attribute, mixed  $value, array  $parameters) : boolean

Validate that an attribute exists in the attributes array, if another attribute exists in the attributes array.

Parameters

string $attribute
mixed $value
array $parameters

Returns

boolean

Tags

None found

validate_confirmed()

validate_confirmed(string  $attribute, mixed  $value) : boolean

Validate that an attribute has a matching confirmation attribute.

Parameters

string $attribute
mixed $value

Returns

boolean

Tags

None found

validate_accepted()

validate_accepted(string  $attribute, mixed  $value) : boolean

Validate that an attribute was "accepted".

This validation rule implies the attribute is "required".

Parameters

string $attribute
mixed $value

Returns

boolean

Tags

None found

validate_same()

validate_same(string  $attribute, mixed  $value, array  $parameters) : boolean

Validate that an attribute is the same as another attribute.

Parameters

string $attribute
mixed $value
array $parameters

Returns

boolean

Tags

None found

validate_different()

validate_different(string  $attribute, mixed  $value, array  $parameters) : boolean

Validate that an attribute is different from another attribute.

Parameters

string $attribute
mixed $value
array $parameters

Returns

boolean

Tags

None found

validate_numeric()

validate_numeric(string  $attribute, mixed  $value) : boolean

Validate that an attribute is numeric.

Parameters

string $attribute
mixed $value

Returns

boolean

Tags

None found

validate_integer()

validate_integer(string  $attribute, mixed  $value) : boolean

Validate that an attribute is an integer.

Parameters

string $attribute
mixed $value

Returns

boolean

Tags

None found

validate_size()

validate_size(string  $attribute, mixed  $value, array  $parameters) : boolean

Validate the size of an attribute.

Parameters

string $attribute
mixed $value
array $parameters

Returns

boolean

Tags

None found

validate_between()

validate_between(string  $attribute, mixed  $value, array  $parameters) : boolean

Validate the size of an attribute is between a set of values.

Parameters

string $attribute
mixed $value
array $parameters

Returns

boolean

Tags

None found

validate_min()

validate_min(string  $attribute, mixed  $value, array  $parameters) : boolean

Validate the size of an attribute is greater than a minimum value.

Parameters

string $attribute
mixed $value
array $parameters

Returns

boolean

Tags

None found

validate_max()

validate_max(string  $attribute, mixed  $value, array  $parameters) : boolean

Validate the size of an attribute is less than a maximum value.

Parameters

string $attribute
mixed $value
array $parameters

Returns

boolean

Tags

None found

size()

size(string  $attribute, mixed  $value) : mixed

Get the size of an attribute.

Parameters

string $attribute
mixed $value

Returns

mixed

Tags

None found

validate_in()

validate_in(string  $attribute, mixed  $value, array  $parameters) : boolean

Validate an attribute is contained within a list of values.

Parameters

string $attribute
mixed $value
array $parameters

Returns

boolean

Tags

None found

validate_not_in()

validate_not_in(string  $attribute, mixed  $value, array  $parameters) : boolean

Validate an attribute is not contained within a list of values.

Parameters

string $attribute
mixed $value
array $parameters

Returns

boolean

Tags

None found

validate_unique()

validate_unique(string  $attribute, mixed  $value, array  $parameters) : boolean

Validate the uniqueness of an attribute value on a given database table.

If a database column is not specified, the attribute will be used.

Parameters

string $attribute
mixed $value
array $parameters

Returns

boolean

Tags

None found

validate_exists()

validate_exists(string  $attribute, mixed  $value, array  $parameters) : boolean

Validate the existence of an attribute value in a database table.

Parameters

string $attribute
mixed $value
array $parameters

Returns

boolean

Tags

None found

validate_ip()

validate_ip(string  $attribute, mixed  $value) : boolean

Validate that an attribute is a valid IP.

Parameters

string $attribute
mixed $value

Returns

boolean

Tags

None found

validate_email()

validate_email(string  $attribute, mixed  $value) : boolean

Validate that an attribute is a valid e-mail address.

Parameters

string $attribute
mixed $value

Returns

boolean

Tags

None found

validate_url()

validate_url(string  $attribute, mixed  $value) : boolean

Validate that an attribute is a valid URL.

Parameters

string $attribute
mixed $value

Returns

boolean

Tags

None found

validate_active_url()

validate_active_url(string  $attribute, mixed  $value) : boolean

Validate that an attribute is an active URL.

Parameters

string $attribute
mixed $value

Returns

boolean

Tags

None found

validate_image()

validate_image(string  $attribute, mixed  $value) : boolean

Validate the MIME type of a file is an image MIME type.

Parameters

string $attribute
mixed $value

Returns

boolean

Tags

None found

validate_alpha()

validate_alpha(string  $attribute, mixed  $value) : boolean

Validate that an attribute contains only alphabetic characters.

Parameters

string $attribute
mixed $value

Returns

boolean

Tags

None found

validate_alpha_num()

validate_alpha_num(string  $attribute, mixed  $value) : boolean

Validate that an attribute contains only alpha-numeric characters.

Parameters

string $attribute
mixed $value

Returns

boolean

Tags

None found

validate_alpha_dash()

validate_alpha_dash(string  $attribute, mixed  $value) : boolean

Validate that an attribute contains only alpha-numeric characters, dashes, and underscores.

Parameters

string $attribute
mixed $value

Returns

boolean

Tags

None found

validate_match()

validate_match(string  $attribute, mixed  $value, array  $parameters) : boolean

Validate that an attribute passes a regular expression check.

Parameters

string $attribute
mixed $value
array $parameters

Returns

boolean

Tags

None found

validate_mimes()

validate_mimes(string  $attribute, array  $value, array  $parameters) : boolean

Validate the MIME type of a file upload attribute is in a set of MIME types.

Parameters

string $attribute
array $value
array $parameters

Returns

boolean

Tags

None found

validate_array()

validate_array(string  $attribute, mixed  $value) : boolean

Validate that an attribute is an array

Parameters

string $attribute
mixed $value

Returns

boolean

Tags

None found

validate_count()

validate_count(string  $attribute, mixed  $value, array  $parameters) : boolean

Validate that an attribute of type array has a specific count

Parameters

string $attribute
mixed $value
array $parameters

Returns

boolean

Tags

None found

validate_countmin()

validate_countmin(string  $attribute, mixed  $value, array  $parameters) : boolean

Validate that an attribute of type array has a minimum of elements.

Parameters

string $attribute
mixed $value
array $parameters

Returns

boolean

Tags

None found

validate_countmax()

validate_countmax(string  $attribute, mixed  $value, array  $parameters) : boolean

Validate that an attribute of type array has a maximum of elements.

Parameters

string $attribute
mixed $value
array $parameters

Returns

boolean

Tags

None found

validate_countbetween()

validate_countbetween(string  $attribute, mixed  $value, array  $parameters) : boolean

Validate that an attribute of type array has elements between max and min.

Parameters

string $attribute
mixed $value
array $parameters

Returns

boolean

Tags

None found

validate_before()

validate_before(string  $attribute, mixed  $value, array  $parameters) : boolean

Validate the date is before a given date.

Parameters

string $attribute
mixed $value
array $parameters

Returns

boolean

Tags

None found

validate_after()

validate_after(string  $attribute, mixed  $value, array  $parameters) : boolean

Validate the date is after a given date.

Parameters

string $attribute
mixed $value
array $parameters

Returns

boolean

Tags

None found

validate_date_format()

validate_date_format(string  $attribute, mixed  $value, array  $parameters) : boolean

Validate the date conforms to a given format.

Parameters

string $attribute
mixed $value
array $parameters

Returns

boolean

Tags

None found

message()

message(string  $attribute, string  $rule) : string

Get the proper error message for an attribute and rule.

Parameters

string $attribute
string $rule

Returns

string

Tags

None found

size_message()

size_message(string  $bundle, string  $attribute, string  $rule) : string

Get the proper error message for an attribute and size rule.

Parameters

string $bundle
string $attribute
string $rule

Returns

string

Tags

None found

replace()

replace(string  $message, string  $attribute, string  $rule, array  $parameters) : string

Replace all error message place-holders with actual values.

Parameters

string $message
string $attribute
string $rule
array $parameters

Returns

string

Tags

None found

replace_required_with()

replace_required_with(string  $message, string  $attribute, string  $rule, array  $parameters) : string

Replace all place-holders for the required_with rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Returns

string

Tags

None found

replace_between()

replace_between(string  $message, string  $attribute, string  $rule, array  $parameters) : string

Replace all place-holders for the between rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Returns

string

Tags

None found

replace_size()

replace_size(string  $message, string  $attribute, string  $rule, array  $parameters) : string

Replace all place-holders for the size rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Returns

string

Tags

None found

replace_min()

replace_min(string  $message, string  $attribute, string  $rule, array  $parameters) : string

Replace all place-holders for the min rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Returns

string

Tags

None found

replace_max()

replace_max(string  $message, string  $attribute, string  $rule, array  $parameters) : string

Replace all place-holders for the max rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Returns

string

Tags

None found

replace_in()

replace_in(string  $message, string  $attribute, string  $rule, array  $parameters) : string

Replace all place-holders for the in rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Returns

string

Tags

None found

replace_not_in()

replace_not_in(string  $message, string  $attribute, string  $rule, array  $parameters) : string

Replace all place-holders for the not_in rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Returns

string

Tags

None found

replace_mimes()

replace_mimes(string  $message, string  $attribute, string  $rule, array  $parameters) : string

Replace all place-holders for the mimes rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Returns

string

Tags

None found

replace_same()

replace_same(string  $message, string  $attribute, string  $rule, array  $parameters) : string

Replace all place-holders for the same rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Returns

string

Tags

None found

replace_different()

replace_different(string  $message, string  $attribute, string  $rule, array  $parameters) : string

Replace all place-holders for the different rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Returns

string

Tags

None found

replace_before()

replace_before(string  $message, string  $attribute, string  $rule, array  $parameters) : string

Replace all place-holders for the before rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Returns

string

Tags

None found

replace_after()

replace_after(string  $message, string  $attribute, string  $rule, array  $parameters) : string

Replace all place-holders for the after rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Returns

string

Tags

None found

replace_count()

replace_count(string  $message, string  $attribute, string  $rule, array  $parameters) : string

Replace all place-holders for the count rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Returns

string

Tags

None found

replace_countmin()

replace_countmin(string  $message, string  $attribute, string  $rule, array  $parameters) : string

Replace all place-holders for the countmin rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Returns

string

Tags

None found

replace_countmax()

replace_countmax(string  $message, string  $attribute, string  $rule, array  $parameters) : string

Replace all place-holders for the countmax rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Returns

string

Tags

None found

replace_countbetween()

replace_countbetween(string  $message, string  $attribute, string  $rule, array  $parameters) : string

Replace all place-holders for the between rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Returns

string

Tags

None found

attribute()

attribute(string  $attribute) : string

Get the displayable name for a given attribute.

Parameters

string $attribute

Returns

string

Tags

None found

has_rule()

has_rule(string  $attribute, array  $rules) : boolean

Determine if an attribute has a rule assigned to it.

Parameters

string $attribute
array $rules

Returns

boolean

Tags

None found

parse()

parse(string  $rule) : array

Extract the rule name and parameters from a rule.

Parameters

string $rule

Returns

array

Tags

None found

db()

db() : \Laravel\Database\Connection

Get the database connection for the Validator.

Returns

LaravelDatabaseConnection

Tags

None found