class Factory implements Factory (View source)

Methods

void
__construct(TranslatorInterface $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
replacer(string $rule, Closure|string $replacer)

Register a custom implicit validator message replacer.

void
resolver(Closure $resolver)

Set the Validator instance resolver.

TranslatorInterface
getTranslator()

Get the Translator implementation.

getPresenceVerifier()

Get the Presence Verifier implementation.

void
setPresenceVerifier(PresenceVerifierInterface $presenceVerifier)

Set the Presence Verifier implementation.

Details

at line line 76
void __construct(TranslatorInterface $translator, Container $container = null)

Create a new Validator factory instance.

Parameters

TranslatorInterface $translator
Container $container

Return Value

void

at line line 91
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 125
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 178
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 195
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 211
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 222
void resolver(Closure $resolver)

Set the Validator instance resolver.

Parameters

Closure $resolver

Return Value

void

at line line 232
TranslatorInterface getTranslator()

Get the Translator implementation.

Return Value

TranslatorInterface

at line line 242
PresenceVerifierInterface getPresenceVerifier()

Get the Presence Verifier implementation.

at line line 253
void setPresenceVerifier(PresenceVerifierInterface $presenceVerifier)

Set the Presence Verifier implementation.

Parameters

PresenceVerifierInterface $presenceVerifier

Return Value

void