Factory
Implements
Properties
$extensions
array|string>
All of the custom validator extensions.
$implicitExtensions
array|string>
All of the custom implicit validator extensions.
$dependentExtensions
array|string>
All of the custom dependent validator extensions.
$replacers
array|string>
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 $attributes ) : Validator
Create a new Validator instance.
Parameters
- $data array
- $rules array
- $messages array
- $attributes array
validate ( array $data , array $rules , array $messages , array $attributes ) : array
Validate the given data against the provided rules.
Parameters
- $data array
- $rules array
- $messages array
- $attributes array
resolve ( array $data , array $rules , array $messages , array $attributes ) : Validator
Resolve a new Validator instance.
Parameters
- $data array
- $rules array
- $messages array
- $attributes 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
includeUnvalidatedArrayKeys ( ) : void
Indicate that unvalidated array keys should be included in validated data when the parent array is validated.
excludeUnvalidatedArrayKeys ( ) : void
Indicate that unvalidated array keys should be excluded from the validated data, 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
getContainer ( ) : Container |null
Get the container instance used by the validation factory.