Factory
Implements
Properties
$extensions array
All of the custom validator extensions.
$implicitExtensions array
All of the custom implicit validator extensions.
$dependentExtensions array
All of the custom dependent validator extensions.
$replacers array
All of the custom validator message replacers.
$fallbackMessages array
All of the fallback messages for custom rules.
$excludeUnvalidatedArrayKeys bool
Indicates that unvalidated array keys should be excluded, even if the parent array was validated.
Methods
__construct ( Translator $translator , Container $container ) : void
Create a new Validator factory instance.
Parameters
- $translator Translator
- $container Container |null
make ( array $data , array $rules , array $messages , array $customAttributes ) : Validator
Create a new Validator instance.
Parameters
- $data array
- $rules array
- $messages array
- $customAttributes array
validate ( array $data , array $rules , array $messages , array $customAttributes ) : array
Validate the given data against the provided rules.
Parameters
- $data array
- $rules array
- $messages array
- $customAttributes array
resolve ( array $data , array $rules , array $messages , array $customAttributes ) : Validator
Resolve a new Validator instance.
Parameters
- $data array
- $rules array
- $messages array
- $customAttributes array
addExtensions ( Validator $validator ) : void
Add the extensions to a validator instance.
Parameters
- $validator Validator
extend ( $rule , $extension , $message ) : void
Register a custom validator extension.
Parameters
- $rule string
- $extension Closure |string
- $message string|null
extendImplicit ( $rule , $extension , $message ) : void
Register a custom implicit validator extension.
Parameters
- $rule string
- $extension Closure |string
- $message string|null
extendDependent ( $rule , $extension , $message ) : void
Register a custom dependent validator extension.
Parameters
- $rule string
- $extension Closure |string
- $message string|null
replacer ( $rule , $replacer ) : void
Register a custom validator message replacer.
Parameters
- $rule string
- $replacer Closure |string
excludeUnvalidatedArrayKeys ( ) : void
Indicate that unvalidated array keys should be excluded, even if the parent array was validated.
resolver ( Closure $resolver ) : void
Set the Validator instance resolver.
Parameters
- $resolver Closure
getPresenceVerifier ( ) : PresenceVerifierInterface
Get the Presence Verifier implementation.
setPresenceVerifier ( PresenceVerifierInterface $presenceVerifier ) : void
Set the Presence Verifier implementation.
Parameters
- $presenceVerifier PresenceVerifierInterface