class Factory implements Factory (View source)

Methods

void
__construct(Translator $translator, Container $container = null)

Create a new Validator factory instance.

make(array $data, array $rules, array $messages = array(), array $customAttributes = array())

Create a new Validator instance.

void
validate(array $data, array $rules, array $messages = array(), array $customAttributes = array())

Validate the given data against the provided rules.

void
extend(string $rule, Closure|string $extension, string $message = null)

Register a custom validator extension.

void
extendImplicit(string $rule, Closure|string $extension, string $message = null)

Register a custom implicit validator extension.

void
extendDependent(string $rule, Closure|string $extension, string $message = null)

Register a custom implicit validator extension.

void
replacer(string $rule, Closure|string $replacer)

Register a custom implicit validator message replacer.

void
resolver(Closure $resolver)

Set the Validator instance resolver.

getTranslator()

Get the Translator implementation.

getPresenceVerifier()

Get the Presence Verifier implementation.

void
setPresenceVerifier(PresenceVerifierInterface $presenceVerifier)

Set the Presence Verifier implementation.

Details

at line line 83
void __construct(Translator $translator, Container $container = null)

Create a new Validator factory instance.

Parameters

Translator $translator
Container $container

Return Value

void

at line line 98
Validator make(array $data, array $rules, array $messages = array(), array $customAttributes = array())

Create a new Validator instance.

Parameters

array $data
array $rules
array $messages
array $customAttributes

Return Value

Validator

at line line 134
void validate(array $data, array $rules, array $messages = array(), array $customAttributes = array())

Validate the given data against the provided rules.

Parameters

array $data
array $rules
array $messages
array $customAttributes

Return Value

void

Exceptions

ValidationException

at line line 187
void extend(string $rule, Closure|string $extension, string $message = null)

Register a custom validator extension.

Parameters

string $rule
Closure|string $extension
string $message

Return Value

void

at line line 204
void extendImplicit(string $rule, Closure|string $extension, string $message = null)

Register a custom implicit validator extension.

Parameters

string $rule
Closure|string $extension
string $message

Return Value

void

at line line 221
void extendDependent(string $rule, Closure|string $extension, string $message = null)

Register a custom implicit validator extension.

Parameters

string $rule
Closure|string $extension
string $message

Return Value

void

at line line 237
void replacer(string $rule, Closure|string $replacer)

Register a custom implicit validator message replacer.

Parameters

string $rule
Closure|string $replacer

Return Value

void

at line line 248
void resolver(Closure $resolver)

Set the Validator instance resolver.

Parameters

Closure $resolver

Return Value

void

at line line 258
Translator getTranslator()

Get the Translator implementation.

Return Value

Translator

at line line 268
PresenceVerifierInterface getPresenceVerifier()

Get the Presence Verifier implementation.

at line line 279
void setPresenceVerifier(PresenceVerifierInterface $presenceVerifier)

Set the Presence Verifier implementation.

Parameters

PresenceVerifierInterface $presenceVerifier

Return Value

void