class Illuminate / Validation / Factory
You are viewing an older version of the documentation. For the latest, please visit master documentation.

Factory

Implements

Properties

protected

$translator Translator

The Translator implementation.

Default: null
protected

$verifier PresenceVerifierInterface

The Presence Verifier implementation.

Default: null
protected

$container Container

The IoC container instance.

Default: null
protected

$extensions array

All of the custom validator extensions.

Default: []
protected

$implicitExtensions array

All of the custom implicit validator extensions.

Default: []
protected

$dependentExtensions array

All of the custom dependent validator extensions.

Default: []
protected

$replacers array

All of the custom validator message replacers.

Default: []
protected

$fallbackMessages array

All of the fallback messages for custom rules.

Default: []
protected

$excludeUnvalidatedArrayKeys bool

Indicates that unvalidated array keys should be excluded, even if the parent array was validated.

Default: null
protected

$resolver Closure

The Validator resolver instance.

Default: null

Methods

public

__construct ( Translator $translator , Container $container ) : void

Create a new Validator factory instance.

Parameters

public

make ( array $data , array $rules , array $messages , array $customAttributes ) : Validator

Create a new Validator instance.

Parameters

  • $data array
  • $rules array
  • $messages array
  • $customAttributes array
public

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
protected

resolve ( array $data , array $rules , array $messages , array $customAttributes ) : Validator

Resolve a new Validator instance.

Parameters

  • $data array
  • $rules array
  • $messages array
  • $customAttributes array
protected

addExtensions ( Validator $validator ) : void

Add the extensions to a validator instance.

Parameters

public

extend ( $rule , $extension , $message ) : void

Register a custom validator extension.

Parameters

  • $rule string
  • $extension Closure |string
  • $message string|null
public

extendImplicit ( $rule , $extension , $message ) : void

Register a custom implicit validator extension.

Parameters

  • $rule string
  • $extension Closure |string
  • $message string|null
public

extendDependent ( $rule , $extension , $message ) : void

Register a custom dependent validator extension.

Parameters

  • $rule string
  • $extension Closure |string
  • $message string|null
public

replacer ( $rule , $replacer ) : void

Register a custom validator message replacer.

Parameters

  • $rule string
  • $replacer Closure |string
public

excludeUnvalidatedArrayKeys ( ) : void

Indicate that unvalidated array keys should be excluded, even if the parent array was validated.

public

resolver ( Closure $resolver ) : void

Set the Validator instance resolver.

Parameters

public

getTranslator ( ) : Translator

Get the Translator implementation.

public

getPresenceVerifier ( ) : PresenceVerifierInterface

Get the Presence Verifier implementation.

public

setPresenceVerifier ( PresenceVerifierInterface $presenceVerifier ) : void

Set the Presence Verifier implementation.

Parameters

public

getContainer ( ) : Container

Get the container instance used by the validation factory.

public

setContainer ( Container $container ) : $this

Set the container instance used by the validation factory.

Parameters