PHP 클래스 Overtrue\Validation\Validator

파일 보기 프로젝트 열기: overtrue/validation 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$after array All of the registered "after" callbacks.
$customAttributes array The array of custom attribute names.
$customMessages array The array of custom error messages.
$customValues array The array of custom displayabled values.
$data array The data under validation.
$extensions array All of the custom validator extensions.
$failedRules array The failed validation rules.
$fallbackMessages array The array of fallback error messages.
$files array The files under validation.
$implicitRules array The validation rules that imply the field is required.
$messages MessageBag The messages.
$numericRules array The numeric related validation rules.
$presenceVerifier Overtrue\Validation\PresenceVerifierInterface The Presence Verifier implementation.
$replacers array All of the custom replacer extensions.
$rules array The rules to be applied to the data.
$sizeRules array The size related validation rules.
$translator Overtrue\Validation\TranslatorInterface The Translator implementation.

공개 메소드들

메소드 설명
__call ( string $method, array $parameters ) : mixed Handle dynamic calls to class methods.
__construct ( Overtrue\Validation\TranslatorInterface $translator, array $data, array $rules, array $messages = [], array $customAttributes = [] ) : Validator Create a new Validator instance.
addCustomAttributes ( array $customAttributes ) Add custom attributes to the validator.
addCustomValues ( array $customValues ) Add the custom values for the validator.
addExtension ( string $rule, Closure | string $extension ) Register a custom validator extension.
addExtensions ( array $extensions ) Register an array of custom validator extensions.
addImplicitExtension ( string $rule, Closure | string $extension ) Register a custom implicit validator extension.
addImplicitExtensions ( array $extensions ) Register an array of custom implicit validator extensions.
addReplacer ( string $rule, Closure | string $replacer ) Register a custom validator message replacer.
addReplacers ( array $replacers ) Register an array of custom validator message replacers.
after ( callable | string $callback ) After an after validation callback.
each ( string $attribute, string | array $rules ) Define a set of rules that apply to each element in an array attribute.
errors ( ) : MessageBag An alternative more semantic shortcut to the message container.
failed ( ) : array Get the failed validation rules.
fails ( ) : boolean Determine if the data fails the validation rules.
getCustomAttributes ( ) : array Get the custom attributes used by the validator.
getCustomMessages ( ) : array Get the custom messages for the validator.
getCustomValues ( ) : array Get the custom values for the validator.
getData ( ) : array Get the data under validation.
getDisplayableValue ( string $attribute, mixed $value ) : string Get the displayable name of the value.
getExtensions ( ) : array Get the array of custom validator extensions.
getFallbackMessages ( ) : array Get the fallback messages for the validator.
getFiles ( ) : array Get the files under validation.
getPresenceVerifier ( ) : Overtrue\Validation\PresenceVerifierInterface Get the Presence Verifier implementation.
getReplacers ( ) : array Get the array of custom validator message replacers.
getRules ( ) : array Get the validation rules.
getTranslator ( ) : Overtrue\Validation\TranslatorInterface Get the Translator implementation.
mergeRules ( string $attribute, string | array $rules ) Merge additional rules into a given attribute.
messages ( ) : MessageBag Get the message container for the validator.
passes ( ) : boolean Determine if the data passes the validation rules.
setAttributeNames ( array $attributes ) Set the custom attributes on the validator.
setCustomMessages ( array $messages ) Set the custom messages for the validator.
setData ( array $data ) Set the data under validation.
setFallbackMessages ( array $messages ) Set the fallback messages for the validator.
setFiles ( array $files ) Set the files under validation.
setPresenceVerifier ( Overtrue\Validation\PresenceVerifierInterface $presenceVerifier ) Set the Presence Verifier implementation.
setRules ( array $rules ) Set the validation rules.
setTranslator ( Overtrue\Validation\TranslatorInterface $translator ) Set the Translator implementation.
setValueNames ( array $values ) Set the custom values on the validator.
sometimes ( string $attribute, string | array $rules, callable $callback ) Add conditions to a given field based on a Closure.

보호된 메소드들

메소드 설명
addError ( string $attribute, string $rule, array $parameters ) Add an error message to the validator's collection of messages.
addFailure ( string $attribute, string $rule, array $parameters ) Add a failed rule and error message to the collection.
allFailingRequired ( array $attributes ) : boolean Determine if all of the given attributes fail the required test.
anyFailingRequired ( array $attributes ) : boolean Determine if any of the given attributes fail the required test.
callClassBasedExtension ( string $callback, array $parameters ) : boolean Call a class based validator extension.
callClassBasedReplacer ( string $callback, string $message, string $attribute, string $rule, array $parameters ) : string Call a class based validator message replacer.
callExtension ( string $rule, array $parameters ) : boolean Call a custom validator extension.
callReplacer ( string $message, string $attribute, string $rule, array $parameters ) : string Call a custom validator message replacer.
checkDateTimeOrder ( string $format, string $before, string $after ) : boolean Given two date/time strings, check that one is after the other.
doReplacements ( string $message, string $attribute, string $rule, array $parameters ) : string Replace all error message place-holders with actual values.
explodeRules ( string | array $rules ) : array Explode the rules into an array of rules.
getAttribute ( string $attribute ) : string Get the displayable name of the attribute.
getAttributeList ( array $values ) : array Transform an array of attributes to their displayable form.
getAttributeType ( string $attribute ) : string Get the data type of the given attribute.
getDateFormat ( string $attribute ) : string | null Get the date format for an attribute if it has one.
getDateTimeWithOptionalFormat ( string $format, string $value ) : DateTime | null Get a DateTime instance from a string.
getExistCount ( string $table, string $column, mixed $value, array $parameters ) : integer Get the number of records that exist in storage.
getExtraConditions ( array $segments ) : array Get the extra conditions for a unique / exists rule.
getExtraExistConditions ( array $parameters ) : array Get the extra exist conditions.
getInlineMessage ( string $attribute, string $lowerRule, array $source = null ) : string Get the inline message for a rule if it exists.
getMessage ( string $attribute, string $rule ) : string Get the validation message for an attribute and rule.
getPresentCount ( array $attributes ) : integer Get the number of attributes in a list that are present.
getRule ( string $attribute, string | array $rules ) : array | null Get a rule and its parameters for a given attribute.
getSize ( string $attribute, mixed $value ) : mixed Get the size of an attribute.
getSizeMessage ( string $attribute, string $rule ) : string Get the proper error message for an attribute and size rule.
getStringSize ( string $value ) : integer Get the size of a string.
getUniqueExtra ( array $parameters ) : array Get the extra conditions for a unique rule.
getUniqueIds ( array $parameters ) : array Get the excluded ID column and value for the unique rule.
getValue ( string $attribute ) : mixed Get the value of a given attribute.
hasRule ( string $attribute, string | array $rules ) : boolean Determine if the given attribute has a rule in the given set.
isImplicit ( string $rule ) : boolean Determine if a given rule implies the attribute is required.
isValidatable ( string $rule, string $attribute, mixed $value ) : boolean Determine if the attribute is validatable.
parseArrayRule ( array $rules ) : array Parse an array based rule.
parseData ( array $data ) : array Parse the data and hydrate the files array.
parseParameters ( string $rule, string $parameter ) : array Parse a parameter list.
parseRule ( array | string $rules ) : array Extract the rule name and parameters from a rule.
parseStringRule ( string $rules ) : array Parse a string based rule.
passesOptionalCheck ( string $attribute ) : boolean Determine if the attribute passes any optional check.
presentOrRuleIsImplicit ( string $rule, string $attribute, mixed $value ) : boolean Determine if the field is present, or the rule implies required.
replaceAfter ( string $message, string $attribute, string $rule, array $parameters ) : string Replace all place-holders for the after rule.
replaceBefore ( string $message, string $attribute, string $rule, array $parameters ) : string Replace all place-holders for the before rule.
replaceBetween ( string $message, string $attribute, string $rule, array $parameters ) : string Replace all place-holders for the between rule.
replaceDateFormat ( string $message, string $attribute, string $rule, array $parameters ) : string Replace all place-holders for the date_format rule.
replaceDifferent ( string $message, string $attribute, string $rule, array $parameters ) : string Replace all place-holders for the different rule.
replaceDigits ( string $message, string $attribute, string $rule, array $parameters ) : string Replace all place-holders for the digits rule.
replaceDigitsBetween ( string $message, string $attribute, string $rule, array $parameters ) : string Replace all place-holders for the digits (between) rule.
replaceIn ( string $message, string $attribute, string $rule, array $parameters ) : string Replace all place-holders for the in rule.
replaceMax ( string $message, string $attribute, string $rule, array $parameters ) : string Replace all place-holders for the max rule.
replaceMimes ( string $message, string $attribute, string $rule, array $parameters ) : string Replace all place-holders for the mimes rule.
replaceMin ( string $message, string $attribute, string $rule, array $parameters ) : string Replace all place-holders for the min rule.
replaceNotIn ( string $message, string $attribute, string $rule, array $parameters ) : string Replace all place-holders for the not_in rule.
replaceRequiredIf ( string $message, string $attribute, string $rule, array $parameters ) : string Replace all place-holders for the required_if rule.
replaceRequiredWith ( string $message, string $attribute, string $rule, array $parameters ) : string Replace all place-holders for the required_with rule.
replaceRequiredWithAll ( string $message, string $attribute, string $rule, array $parameters ) : string Replace all place-holders for the required_with_all rule.
replaceRequiredWithout ( string $message, string $attribute, string $rule, array $parameters ) : string Replace all place-holders for the required_without rule.
replaceRequiredWithoutAll ( string $message, string $attribute, string $rule, array $parameters ) : string Replace all place-holders for the required_without_all rule.
replaceSame ( string $message, string $attribute, string $rule, array $parameters ) : string Replace all place-holders for the same rule.
replaceSize ( string $message, string $attribute, string $rule, array $parameters ) : string Replace all place-holders for the size rule.
requireParameterCount ( integer $count, array $parameters, string $rule ) Require a certain number of parameters to be present.
validate ( string $attribute, string $rule ) Validate a given attribute against a rule.
validateAccepted ( string $attribute, mixed $value ) : boolean Validate that an attribute was "accepted".
validateActiveUrl ( string $attribute, mixed $value ) : boolean Validate that an attribute is an active URL.
validateAfter ( string $attribute, mixed $value, array $parameters ) : boolean Validate the date is after a given date.
validateAfterWithFormat ( string $format, mixed $value, array $parameters ) : boolean Validate the date is after a given date with a given format.
validateAlpha ( string $attribute, mixed $value ) : boolean Validate that an attribute contains only alphabetic characters.
validateAlphaDash ( string $attribute, mixed $value ) : boolean Validate that an attribute contains only alpha-numeric characters, dashes, and underscores.
validateAlphaNum ( string $attribute, mixed $value ) : boolean Validate that an attribute contains only alpha-numeric characters.
validateArray ( string $attribute, mixed $value ) : boolean Validate that an attribute is an array.
validateBefore ( string $attribute, mixed $value, array $parameters ) : boolean Validate the date is before a given date.
validateBeforeWithFormat ( string $format, mixed $value, array $parameters ) : boolean Validate the date is before a given date with a given format.
validateBetween ( string $attribute, mixed $value, array $parameters ) : boolean Validate the size of an attribute is between a set of values.
validateBoolean ( string $attribute, mixed $value ) : boolean Validate that an attribute is a boolean.
validateConfirmed ( string $attribute, mixed $value ) : boolean Validate that an attribute has a matching confirmation.
validateDate ( string $attribute, mixed $value ) : boolean Validate that an attribute is a valid date.
validateDateFormat ( string $attribute, mixed $value, array $parameters ) : boolean Validate that an attribute matches a date format.
validateDifferent ( string $attribute, mixed $value, array $parameters ) : boolean Validate that an attribute is different from another attribute.
validateDigits ( string $attribute, mixed $value, array $parameters ) : boolean Validate that an attribute has a given number of digits.
validateDigitsBetween ( string $attribute, mixed $value, array $parameters ) : boolean Validate that an attribute is between a given number of digits.
validateEmail ( string $attribute, mixed $value ) : boolean Validate that an attribute is a valid e-mail address.
validateExists ( string $attribute, mixed $value, array $parameters ) : boolean Validate the existence of an attribute value in a database table.
validateFilled ( string $attribute, mixed $value ) : boolean Validate the given attribute is filled if it is present.
validateImage ( string $attribute, mixed $value ) : boolean Validate the MIME type of a file is an image MIME type.
validateIn ( string $attribute, mixed $value, array $parameters ) : boolean Validate an attribute is contained within a list of values.
validateInteger ( string $attribute, mixed $value ) : boolean Validate that an attribute is an integer.
validateIp ( string $attribute, mixed $value ) : boolean Validate that an attribute is a valid IP.
validateMax ( string $attribute, mixed $value, array $parameters ) : boolean Validate the size of an attribute is less than a maximum value.
validateMimes ( string $attribute, array $value, array $parameters ) : boolean Validate the MIME type of a file upload attribute is in a set of MIME types.
validateMin ( string $attribute, mixed $value, array $parameters ) : boolean Validate the size of an attribute is greater than a minimum value.
validateNotIn ( string $attribute, mixed $value, array $parameters ) : boolean Validate an attribute is not contained within a list of values.
validateNumeric ( string $attribute, mixed $value ) : boolean Validate that an attribute is numeric.
validateRegex ( string $attribute, mixed $value, array $parameters ) : boolean Validate that an attribute passes a regular expression check.
validateRequired ( string $attribute, mixed $value ) : boolean Validate that a required attribute exists.
validateRequiredIf ( string $attribute, mixed $value, mixed $parameters ) : boolean Validate that an attribute exists when another attribute has a given value.
validateRequiredWith ( string $attribute, mixed $value, mixed $parameters ) : boolean Validate that an attribute exists when any other attribute exists.
validateRequiredWithAll ( string $attribute, mixed $value, mixed $parameters ) : boolean Validate that an attribute exists when all other attributes exists.
validateRequiredWithout ( string $attribute, mixed $value, mixed $parameters ) : boolean Validate that an attribute exists when another attribute does not.
validateRequiredWithoutAll ( string $attribute, mixed $value, mixed $parameters ) : boolean Validate that an attribute exists when all other attributes do not.
validateSame ( string $attribute, mixed $value, array $parameters ) : boolean Validate that two attributes match.
validateSize ( string $attribute, mixed $value, array $parameters ) : boolean Validate the size of an attribute.
validateSometimes ( ) : boolean "Validate" optional attributes.
validateTimezone ( string $attribute, mixed $value ) : boolean Validate that an attribute is a valid timezone.
validateUnique ( string $attribute, mixed $value, array $parameters ) : boolean Validate the uniqueness of an attribute value on a given database table.
validateUrl ( string $attribute, mixed $value ) : boolean Validate that an attribute is a valid URL.

메소드 상세

__call() 공개 메소드

Handle dynamic calls to class methods.
public __call ( string $method, array $parameters ) : mixed
$method string
$parameters array
리턴 mixed

__construct() 공개 메소드

Create a new Validator instance.
public __construct ( Overtrue\Validation\TranslatorInterface $translator, array $data, array $rules, array $messages = [], array $customAttributes = [] ) : Validator
$translator Overtrue\Validation\TranslatorInterface
$data array
$rules array
$messages array
$customAttributes array
리턴 Validator

addCustomAttributes() 공개 메소드

Add custom attributes to the validator.
public addCustomAttributes ( array $customAttributes )
$customAttributes array

addCustomValues() 공개 메소드

Add the custom values for the validator.
public addCustomValues ( array $customValues )
$customValues array

addError() 보호된 메소드

Add an error message to the validator's collection of messages.
protected addError ( string $attribute, string $rule, array $parameters )
$attribute string
$rule string
$parameters array

addExtension() 공개 메소드

Register a custom validator extension.
public addExtension ( string $rule, Closure | string $extension )
$rule string
$extension Closure | string

addExtensions() 공개 메소드

Register an array of custom validator extensions.
public addExtensions ( array $extensions )
$extensions array

addFailure() 보호된 메소드

Add a failed rule and error message to the collection.
protected addFailure ( string $attribute, string $rule, array $parameters )
$attribute string
$rule string
$parameters array

addImplicitExtension() 공개 메소드

Register a custom implicit validator extension.
public addImplicitExtension ( string $rule, Closure | string $extension )
$rule string
$extension Closure | string

addImplicitExtensions() 공개 메소드

Register an array of custom implicit validator extensions.
public addImplicitExtensions ( array $extensions )
$extensions array

addReplacer() 공개 메소드

Register a custom validator message replacer.
public addReplacer ( string $rule, Closure | string $replacer )
$rule string
$replacer Closure | string

addReplacers() 공개 메소드

Register an array of custom validator message replacers.
public addReplacers ( array $replacers )
$replacers array

after() 공개 메소드

After an after validation callback.
public after ( callable | string $callback )
$callback callable | string

allFailingRequired() 보호된 메소드

Determine if all of the given attributes fail the required test.
protected allFailingRequired ( array $attributes ) : boolean
$attributes array
리턴 boolean

anyFailingRequired() 보호된 메소드

Determine if any of the given attributes fail the required test.
protected anyFailingRequired ( array $attributes ) : boolean
$attributes array
리턴 boolean

callClassBasedExtension() 보호된 메소드

Call a class based validator extension.
protected callClassBasedExtension ( string $callback, array $parameters ) : boolean
$callback string
$parameters array
리턴 boolean

callClassBasedReplacer() 보호된 메소드

Call a class based validator message replacer.
protected callClassBasedReplacer ( string $callback, string $message, string $attribute, string $rule, array $parameters ) : string
$callback string
$message string
$attribute string
$rule string
$parameters array
리턴 string

callExtension() 보호된 메소드

Call a custom validator extension.
protected callExtension ( string $rule, array $parameters ) : boolean
$rule string
$parameters array
리턴 boolean

callReplacer() 보호된 메소드

Call a custom validator message replacer.
protected callReplacer ( string $message, string $attribute, string $rule, array $parameters ) : string
$message string
$attribute string
$rule string
$parameters array
리턴 string

checkDateTimeOrder() 보호된 메소드

Given two date/time strings, check that one is after the other.
protected checkDateTimeOrder ( string $format, string $before, string $after ) : boolean
$format string
$before string
$after string
리턴 boolean

doReplacements() 보호된 메소드

Replace all error message place-holders with actual values.
protected doReplacements ( string $message, string $attribute, string $rule, array $parameters ) : string
$message string
$attribute string
$rule string
$parameters array
리턴 string

each() 공개 메소드

Define a set of rules that apply to each element in an array attribute.
public each ( string $attribute, string | array $rules )
$attribute string
$rules string | array

errors() 공개 메소드

An alternative more semantic shortcut to the message container.
public errors ( ) : MessageBag
리턴 MessageBag

explodeRules() 보호된 메소드

Explode the rules into an array of rules.
protected explodeRules ( string | array $rules ) : array
$rules string | array
리턴 array

failed() 공개 메소드

Get the failed validation rules.
public failed ( ) : array
리턴 array

fails() 공개 메소드

Determine if the data fails the validation rules.
public fails ( ) : boolean
리턴 boolean

getAttribute() 보호된 메소드

Get the displayable name of the attribute.
protected getAttribute ( string $attribute ) : string
$attribute string
리턴 string

getAttributeList() 보호된 메소드

Transform an array of attributes to their displayable form.
protected getAttributeList ( array $values ) : array
$values array
리턴 array

getAttributeType() 보호된 메소드

Get the data type of the given attribute.
protected getAttributeType ( string $attribute ) : string
$attribute string
리턴 string

getCustomAttributes() 공개 메소드

Get the custom attributes used by the validator.
public getCustomAttributes ( ) : array
리턴 array

getCustomMessages() 공개 메소드

Get the custom messages for the validator.
public getCustomMessages ( ) : array
리턴 array

getCustomValues() 공개 메소드

Get the custom values for the validator.
public getCustomValues ( ) : array
리턴 array

getData() 공개 메소드

Get the data under validation.
public getData ( ) : array
리턴 array

getDateFormat() 보호된 메소드

Get the date format for an attribute if it has one.
protected getDateFormat ( string $attribute ) : string | null
$attribute string
리턴 string | null

getDateTimeWithOptionalFormat() 보호된 메소드

Get a DateTime instance from a string.
protected getDateTimeWithOptionalFormat ( string $format, string $value ) : DateTime | null
$format string
$value string
리턴 DateTime | null

getDisplayableValue() 공개 메소드

Get the displayable name of the value.
public getDisplayableValue ( string $attribute, mixed $value ) : string
$attribute string
$value mixed
리턴 string

getExistCount() 보호된 메소드

Get the number of records that exist in storage.
protected getExistCount ( string $table, string $column, mixed $value, array $parameters ) : integer
$table string
$column string
$value mixed
$parameters array
리턴 integer

getExtensions() 공개 메소드

Get the array of custom validator extensions.
public getExtensions ( ) : array
리턴 array

getExtraConditions() 보호된 메소드

Get the extra conditions for a unique / exists rule.
protected getExtraConditions ( array $segments ) : array
$segments array
리턴 array

getExtraExistConditions() 보호된 메소드

Get the extra exist conditions.
protected getExtraExistConditions ( array $parameters ) : array
$parameters array
리턴 array

getFallbackMessages() 공개 메소드

Get the fallback messages for the validator.
public getFallbackMessages ( ) : array
리턴 array

getFiles() 공개 메소드

Get the files under validation.
public getFiles ( ) : array
리턴 array

getInlineMessage() 보호된 메소드

Get the inline message for a rule if it exists.
protected getInlineMessage ( string $attribute, string $lowerRule, array $source = null ) : string
$attribute string
$lowerRule string
$source array
리턴 string

getMessage() 보호된 메소드

Get the validation message for an attribute and rule.
protected getMessage ( string $attribute, string $rule ) : string
$attribute string
$rule string
리턴 string

getPresenceVerifier() 공개 메소드

Get the Presence Verifier implementation.
public getPresenceVerifier ( ) : Overtrue\Validation\PresenceVerifierInterface
리턴 Overtrue\Validation\PresenceVerifierInterface

getPresentCount() 보호된 메소드

Get the number of attributes in a list that are present.
protected getPresentCount ( array $attributes ) : integer
$attributes array
리턴 integer

getReplacers() 공개 메소드

Get the array of custom validator message replacers.
public getReplacers ( ) : array
리턴 array

getRule() 보호된 메소드

Get a rule and its parameters for a given attribute.
protected getRule ( string $attribute, string | array $rules ) : array | null
$attribute string
$rules string | array
리턴 array | null

getRules() 공개 메소드

Get the validation rules.
public getRules ( ) : array
리턴 array

getSize() 보호된 메소드

Get the size of an attribute.
protected getSize ( string $attribute, mixed $value ) : mixed
$attribute string
$value mixed
리턴 mixed

getSizeMessage() 보호된 메소드

Get the proper error message for an attribute and size rule.
protected getSizeMessage ( string $attribute, string $rule ) : string
$attribute string
$rule string
리턴 string

getStringSize() 보호된 메소드

Get the size of a string.
protected getStringSize ( string $value ) : integer
$value string
리턴 integer

getTranslator() 공개 메소드

Get the Translator implementation.
public getTranslator ( ) : Overtrue\Validation\TranslatorInterface
리턴 Overtrue\Validation\TranslatorInterface

getUniqueExtra() 보호된 메소드

Get the extra conditions for a unique rule.
protected getUniqueExtra ( array $parameters ) : array
$parameters array
리턴 array

getUniqueIds() 보호된 메소드

Get the excluded ID column and value for the unique rule.
protected getUniqueIds ( array $parameters ) : array
$parameters array
리턴 array

getValue() 보호된 메소드

Get the value of a given attribute.
protected getValue ( string $attribute ) : mixed
$attribute string
리턴 mixed

hasRule() 보호된 메소드

Determine if the given attribute has a rule in the given set.
protected hasRule ( string $attribute, string | array $rules ) : boolean
$attribute string
$rules string | array
리턴 boolean

isImplicit() 보호된 메소드

Determine if a given rule implies the attribute is required.
protected isImplicit ( string $rule ) : boolean
$rule string
리턴 boolean

isValidatable() 보호된 메소드

Determine if the attribute is validatable.
protected isValidatable ( string $rule, string $attribute, mixed $value ) : boolean
$rule string
$attribute string
$value mixed
리턴 boolean

mergeRules() 공개 메소드

Merge additional rules into a given attribute.
public mergeRules ( string $attribute, string | array $rules )
$attribute string
$rules string | array

messages() 공개 메소드

Get the message container for the validator.
public messages ( ) : MessageBag
리턴 MessageBag

parseArrayRule() 보호된 메소드

Parse an array based rule.
protected parseArrayRule ( array $rules ) : array
$rules array
리턴 array

parseData() 보호된 메소드

Parse the data and hydrate the files array.
protected parseData ( array $data ) : array
$data array
리턴 array

parseParameters() 보호된 메소드

Parse a parameter list.
protected parseParameters ( string $rule, string $parameter ) : array
$rule string
$parameter string
리턴 array

parseRule() 보호된 메소드

Extract the rule name and parameters from a rule.
protected parseRule ( array | string $rules ) : array
$rules array | string
리턴 array

parseStringRule() 보호된 메소드

Parse a string based rule.
protected parseStringRule ( string $rules ) : array
$rules string
리턴 array

passes() 공개 메소드

Determine if the data passes the validation rules.
public passes ( ) : boolean
리턴 boolean

passesOptionalCheck() 보호된 메소드

Determine if the attribute passes any optional check.
protected passesOptionalCheck ( string $attribute ) : boolean
$attribute string
리턴 boolean

presentOrRuleIsImplicit() 보호된 메소드

Determine if the field is present, or the rule implies required.
protected presentOrRuleIsImplicit ( string $rule, string $attribute, mixed $value ) : boolean
$rule string
$attribute string
$value mixed
리턴 boolean

replaceAfter() 보호된 메소드

Replace all place-holders for the after rule.
protected replaceAfter ( string $message, string $attribute, string $rule, array $parameters ) : string
$message string
$attribute string
$rule string
$parameters array
리턴 string

replaceBefore() 보호된 메소드

Replace all place-holders for the before rule.
protected replaceBefore ( string $message, string $attribute, string $rule, array $parameters ) : string
$message string
$attribute string
$rule string
$parameters array
리턴 string

replaceBetween() 보호된 메소드

Replace all place-holders for the between rule.
protected replaceBetween ( string $message, string $attribute, string $rule, array $parameters ) : string
$message string
$attribute string
$rule string
$parameters array
리턴 string

replaceDateFormat() 보호된 메소드

Replace all place-holders for the date_format rule.
protected replaceDateFormat ( string $message, string $attribute, string $rule, array $parameters ) : string
$message string
$attribute string
$rule string
$parameters array
리턴 string

replaceDifferent() 보호된 메소드

Replace all place-holders for the different rule.
protected replaceDifferent ( string $message, string $attribute, string $rule, array $parameters ) : string
$message string
$attribute string
$rule string
$parameters array
리턴 string

replaceDigits() 보호된 메소드

Replace all place-holders for the digits rule.
protected replaceDigits ( string $message, string $attribute, string $rule, array $parameters ) : string
$message string
$attribute string
$rule string
$parameters array
리턴 string

replaceDigitsBetween() 보호된 메소드

Replace all place-holders for the digits (between) rule.
protected replaceDigitsBetween ( string $message, string $attribute, string $rule, array $parameters ) : string
$message string
$attribute string
$rule string
$parameters array
리턴 string

replaceIn() 보호된 메소드

Replace all place-holders for the in rule.
protected replaceIn ( string $message, string $attribute, string $rule, array $parameters ) : string
$message string
$attribute string
$rule string
$parameters array
리턴 string

replaceMax() 보호된 메소드

Replace all place-holders for the max rule.
protected replaceMax ( string $message, string $attribute, string $rule, array $parameters ) : string
$message string
$attribute string
$rule string
$parameters array
리턴 string

replaceMimes() 보호된 메소드

Replace all place-holders for the mimes rule.
protected replaceMimes ( string $message, string $attribute, string $rule, array $parameters ) : string
$message string
$attribute string
$rule string
$parameters array
리턴 string

replaceMin() 보호된 메소드

Replace all place-holders for the min rule.
protected replaceMin ( string $message, string $attribute, string $rule, array $parameters ) : string
$message string
$attribute string
$rule string
$parameters array
리턴 string

replaceNotIn() 보호된 메소드

Replace all place-holders for the not_in rule.
protected replaceNotIn ( string $message, string $attribute, string $rule, array $parameters ) : string
$message string
$attribute string
$rule string
$parameters array
리턴 string

replaceRequiredIf() 보호된 메소드

Replace all place-holders for the required_if rule.
protected replaceRequiredIf ( string $message, string $attribute, string $rule, array $parameters ) : string
$message string
$attribute string
$rule string
$parameters array
리턴 string

replaceRequiredWith() 보호된 메소드

Replace all place-holders for the required_with rule.
protected replaceRequiredWith ( string $message, string $attribute, string $rule, array $parameters ) : string
$message string
$attribute string
$rule string
$parameters array
리턴 string

replaceRequiredWithAll() 보호된 메소드

Replace all place-holders for the required_with_all rule.
protected replaceRequiredWithAll ( string $message, string $attribute, string $rule, array $parameters ) : string
$message string
$attribute string
$rule string
$parameters array
리턴 string

replaceRequiredWithout() 보호된 메소드

Replace all place-holders for the required_without rule.
protected replaceRequiredWithout ( string $message, string $attribute, string $rule, array $parameters ) : string
$message string
$attribute string
$rule string
$parameters array
리턴 string

replaceRequiredWithoutAll() 보호된 메소드

Replace all place-holders for the required_without_all rule.
protected replaceRequiredWithoutAll ( string $message, string $attribute, string $rule, array $parameters ) : string
$message string
$attribute string
$rule string
$parameters array
리턴 string

replaceSame() 보호된 메소드

Replace all place-holders for the same rule.
protected replaceSame ( string $message, string $attribute, string $rule, array $parameters ) : string
$message string
$attribute string
$rule string
$parameters array
리턴 string

replaceSize() 보호된 메소드

Replace all place-holders for the size rule.
protected replaceSize ( string $message, string $attribute, string $rule, array $parameters ) : string
$message string
$attribute string
$rule string
$parameters array
리턴 string

requireParameterCount() 보호된 메소드

Require a certain number of parameters to be present.
protected requireParameterCount ( integer $count, array $parameters, string $rule )
$count integer
$parameters array
$rule string

setAttributeNames() 공개 메소드

Set the custom attributes on the validator.
public setAttributeNames ( array $attributes )
$attributes array

setCustomMessages() 공개 메소드

Set the custom messages for the validator.
public setCustomMessages ( array $messages )
$messages array

setData() 공개 메소드

Set the data under validation.
public setData ( array $data )
$data array

setFallbackMessages() 공개 메소드

Set the fallback messages for the validator.
public setFallbackMessages ( array $messages )
$messages array

setFiles() 공개 메소드

Set the files under validation.
public setFiles ( array $files )
$files array

setPresenceVerifier() 공개 메소드

Set the Presence Verifier implementation.
public setPresenceVerifier ( Overtrue\Validation\PresenceVerifierInterface $presenceVerifier )
$presenceVerifier Overtrue\Validation\PresenceVerifierInterface

setRules() 공개 메소드

Set the validation rules.
public setRules ( array $rules )
$rules array

setTranslator() 공개 메소드

Set the Translator implementation.
public setTranslator ( Overtrue\Validation\TranslatorInterface $translator )
$translator Overtrue\Validation\TranslatorInterface

setValueNames() 공개 메소드

Set the custom values on the validator.
public setValueNames ( array $values )
$values array

sometimes() 공개 메소드

Add conditions to a given field based on a Closure.
public sometimes ( string $attribute, string | array $rules, callable $callback )
$attribute string
$rules string | array
$callback callable

validate() 보호된 메소드

Validate a given attribute against a rule.
protected validate ( string $attribute, string $rule )
$attribute string
$rule string

validateAccepted() 보호된 메소드

This validation rule implies the attribute is "required".
protected validateAccepted ( string $attribute, mixed $value ) : boolean
$attribute string
$value mixed
리턴 boolean

validateActiveUrl() 보호된 메소드

Validate that an attribute is an active URL.
protected validateActiveUrl ( string $attribute, mixed $value ) : boolean
$attribute string
$value mixed
리턴 boolean

validateAfter() 보호된 메소드

Validate the date is after a given date.
protected validateAfter ( string $attribute, mixed $value, array $parameters ) : boolean
$attribute string
$value mixed
$parameters array
리턴 boolean

validateAfterWithFormat() 보호된 메소드

Validate the date is after a given date with a given format.
protected validateAfterWithFormat ( string $format, mixed $value, array $parameters ) : boolean
$format string
$value mixed
$parameters array
리턴 boolean

validateAlpha() 보호된 메소드

Validate that an attribute contains only alphabetic characters.
protected validateAlpha ( string $attribute, mixed $value ) : boolean
$attribute string
$value mixed
리턴 boolean

validateAlphaDash() 보호된 메소드

Validate that an attribute contains only alpha-numeric characters, dashes, and underscores.
protected validateAlphaDash ( string $attribute, mixed $value ) : boolean
$attribute string
$value mixed
리턴 boolean

validateAlphaNum() 보호된 메소드

Validate that an attribute contains only alpha-numeric characters.
protected validateAlphaNum ( string $attribute, mixed $value ) : boolean
$attribute string
$value mixed
리턴 boolean

validateArray() 보호된 메소드

Validate that an attribute is an array.
protected validateArray ( string $attribute, mixed $value ) : boolean
$attribute string
$value mixed
리턴 boolean

validateBefore() 보호된 메소드

Validate the date is before a given date.
protected validateBefore ( string $attribute, mixed $value, array $parameters ) : boolean
$attribute string
$value mixed
$parameters array
리턴 boolean

validateBeforeWithFormat() 보호된 메소드

Validate the date is before a given date with a given format.
protected validateBeforeWithFormat ( string $format, mixed $value, array $parameters ) : boolean
$format string
$value mixed
$parameters array
리턴 boolean

validateBetween() 보호된 메소드

Validate the size of an attribute is between a set of values.
protected validateBetween ( string $attribute, mixed $value, array $parameters ) : boolean
$attribute string
$value mixed
$parameters array
리턴 boolean

validateBoolean() 보호된 메소드

Validate that an attribute is a boolean.
protected validateBoolean ( string $attribute, mixed $value ) : boolean
$attribute string
$value mixed
리턴 boolean

validateConfirmed() 보호된 메소드

Validate that an attribute has a matching confirmation.
protected validateConfirmed ( string $attribute, mixed $value ) : boolean
$attribute string
$value mixed
리턴 boolean

validateDate() 보호된 메소드

Validate that an attribute is a valid date.
protected validateDate ( string $attribute, mixed $value ) : boolean
$attribute string
$value mixed
리턴 boolean

validateDateFormat() 보호된 메소드

Validate that an attribute matches a date format.
protected validateDateFormat ( string $attribute, mixed $value, array $parameters ) : boolean
$attribute string
$value mixed
$parameters array
리턴 boolean

validateDifferent() 보호된 메소드

Validate that an attribute is different from another attribute.
protected validateDifferent ( string $attribute, mixed $value, array $parameters ) : boolean
$attribute string
$value mixed
$parameters array
리턴 boolean

validateDigits() 보호된 메소드

Validate that an attribute has a given number of digits.
protected validateDigits ( string $attribute, mixed $value, array $parameters ) : boolean
$attribute string
$value mixed
$parameters array
리턴 boolean

validateDigitsBetween() 보호된 메소드

Validate that an attribute is between a given number of digits.
protected validateDigitsBetween ( string $attribute, mixed $value, array $parameters ) : boolean
$attribute string
$value mixed
$parameters array
리턴 boolean

validateEmail() 보호된 메소드

Validate that an attribute is a valid e-mail address.
protected validateEmail ( string $attribute, mixed $value ) : boolean
$attribute string
$value mixed
리턴 boolean

validateExists() 보호된 메소드

Validate the existence of an attribute value in a database table.
protected validateExists ( string $attribute, mixed $value, array $parameters ) : boolean
$attribute string
$value mixed
$parameters array
리턴 boolean

validateFilled() 보호된 메소드

Validate the given attribute is filled if it is present.
protected validateFilled ( string $attribute, mixed $value ) : boolean
$attribute string
$value mixed
리턴 boolean

validateImage() 보호된 메소드

Validate the MIME type of a file is an image MIME type.
protected validateImage ( string $attribute, mixed $value ) : boolean
$attribute string
$value mixed
리턴 boolean

validateIn() 보호된 메소드

Validate an attribute is contained within a list of values.
protected validateIn ( string $attribute, mixed $value, array $parameters ) : boolean
$attribute string
$value mixed
$parameters array
리턴 boolean

validateInteger() 보호된 메소드

Validate that an attribute is an integer.
protected validateInteger ( string $attribute, mixed $value ) : boolean
$attribute string
$value mixed
리턴 boolean

validateIp() 보호된 메소드

Validate that an attribute is a valid IP.
protected validateIp ( string $attribute, mixed $value ) : boolean
$attribute string
$value mixed
리턴 boolean

validateMax() 보호된 메소드

Validate the size of an attribute is less than a maximum value.
protected validateMax ( string $attribute, mixed $value, array $parameters ) : boolean
$attribute string
$value mixed
$parameters array
리턴 boolean

validateMimes() 보호된 메소드

Validate the MIME type of a file upload attribute is in a set of MIME types.
protected validateMimes ( string $attribute, array $value, array $parameters ) : boolean
$attribute string
$value array
$parameters array
리턴 boolean

validateMin() 보호된 메소드

Validate the size of an attribute is greater than a minimum value.
protected validateMin ( string $attribute, mixed $value, array $parameters ) : boolean
$attribute string
$value mixed
$parameters array
리턴 boolean

validateNotIn() 보호된 메소드

Validate an attribute is not contained within a list of values.
protected validateNotIn ( string $attribute, mixed $value, array $parameters ) : boolean
$attribute string
$value mixed
$parameters array
리턴 boolean

validateNumeric() 보호된 메소드

Validate that an attribute is numeric.
protected validateNumeric ( string $attribute, mixed $value ) : boolean
$attribute string
$value mixed
리턴 boolean

validateRegex() 보호된 메소드

Validate that an attribute passes a regular expression check.
protected validateRegex ( string $attribute, mixed $value, array $parameters ) : boolean
$attribute string
$value mixed
$parameters array
리턴 boolean

validateRequired() 보호된 메소드

Validate that a required attribute exists.
protected validateRequired ( string $attribute, mixed $value ) : boolean
$attribute string
$value mixed
리턴 boolean

validateRequiredIf() 보호된 메소드

Validate that an attribute exists when another attribute has a given value.
protected validateRequiredIf ( string $attribute, mixed $value, mixed $parameters ) : boolean
$attribute string
$value mixed
$parameters mixed
리턴 boolean

validateRequiredWith() 보호된 메소드

Validate that an attribute exists when any other attribute exists.
protected validateRequiredWith ( string $attribute, mixed $value, mixed $parameters ) : boolean
$attribute string
$value mixed
$parameters mixed
리턴 boolean

validateRequiredWithAll() 보호된 메소드

Validate that an attribute exists when all other attributes exists.
protected validateRequiredWithAll ( string $attribute, mixed $value, mixed $parameters ) : boolean
$attribute string
$value mixed
$parameters mixed
리턴 boolean

validateRequiredWithout() 보호된 메소드

Validate that an attribute exists when another attribute does not.
protected validateRequiredWithout ( string $attribute, mixed $value, mixed $parameters ) : boolean
$attribute string
$value mixed
$parameters mixed
리턴 boolean

validateRequiredWithoutAll() 보호된 메소드

Validate that an attribute exists when all other attributes do not.
protected validateRequiredWithoutAll ( string $attribute, mixed $value, mixed $parameters ) : boolean
$attribute string
$value mixed
$parameters mixed
리턴 boolean

validateSame() 보호된 메소드

Validate that two attributes match.
protected validateSame ( string $attribute, mixed $value, array $parameters ) : boolean
$attribute string
$value mixed
$parameters array
리턴 boolean

validateSize() 보호된 메소드

Validate the size of an attribute.
protected validateSize ( string $attribute, mixed $value, array $parameters ) : boolean
$attribute string
$value mixed
$parameters array
리턴 boolean

validateSometimes() 보호된 메소드

Always returns true, just lets us put sometimes in rules.
protected validateSometimes ( ) : boolean
리턴 boolean

validateTimezone() 보호된 메소드

Validate that an attribute is a valid timezone.
protected validateTimezone ( string $attribute, mixed $value ) : boolean
$attribute string
$value mixed
리턴 boolean

validateUnique() 보호된 메소드

If a database column is not specified, the attribute will be used.
protected validateUnique ( string $attribute, mixed $value, array $parameters ) : boolean
$attribute string
$value mixed
$parameters array
리턴 boolean

validateUrl() 보호된 메소드

Validate that an attribute is a valid URL.
protected validateUrl ( string $attribute, mixed $value ) : boolean
$attribute string
$value mixed
리턴 boolean

프로퍼티 상세

$after 보호되어 있는 프로퍼티

All of the registered "after" callbacks.
protected array $after
리턴 array

$customAttributes 보호되어 있는 프로퍼티

The array of custom attribute names.
protected array $customAttributes
리턴 array

$customMessages 보호되어 있는 프로퍼티

The array of custom error messages.
protected array $customMessages
리턴 array

$customValues 보호되어 있는 프로퍼티

The array of custom displayabled values.
protected array $customValues
리턴 array

$data 보호되어 있는 프로퍼티

The data under validation.
protected array $data
리턴 array

$extensions 보호되어 있는 프로퍼티

All of the custom validator extensions.
protected array $extensions
리턴 array

$failedRules 보호되어 있는 프로퍼티

The failed validation rules.
protected array $failedRules
리턴 array

$fallbackMessages 보호되어 있는 프로퍼티

The array of fallback error messages.
protected array $fallbackMessages
리턴 array

$files 보호되어 있는 프로퍼티

The files under validation.
protected array $files
리턴 array

$implicitRules 보호되어 있는 프로퍼티

The validation rules that imply the field is required.
protected array $implicitRules
리턴 array

$messages 보호되어 있는 프로퍼티

The messages.
protected MessageBag,Overtrue\Validation $messages
리턴 MessageBag

$numericRules 보호되어 있는 프로퍼티

The numeric related validation rules.
protected array $numericRules
리턴 array

$presenceVerifier 보호되어 있는 프로퍼티

The Presence Verifier implementation.
protected PresenceVerifierInterface,Overtrue\Validation $presenceVerifier
리턴 Overtrue\Validation\PresenceVerifierInterface

$replacers 보호되어 있는 프로퍼티

All of the custom replacer extensions.
protected array $replacers
리턴 array

$rules 보호되어 있는 프로퍼티

The rules to be applied to the data.
protected array $rules
리턴 array

$sizeRules 보호되어 있는 프로퍼티

The size related validation rules.
protected array $sizeRules
리턴 array

$translator 보호되어 있는 프로퍼티

The Translator implementation.
protected TranslatorInterface,Overtrue\Validation $translator
리턴 Overtrue\Validation\TranslatorInterface