trait Illuminate / Validation / Concerns / FormatsMessages
You are viewing an older version of the documentation. For the latest, please visit master documentation.

FormatsMessages

Methods

protected

getMessage ( $attribute , $rule ) : string

Get the validation message for an attribute and rule.

Parameters

  • $attribute string
  • $rule string
protected

getInlineMessage ( $attribute , $rule ) : string|null

Get the proper inline error message for standard and size rules.

Parameters

  • $attribute string
  • $rule string
protected

getFromLocalArray ( $attribute , $lowerRule , $source ) : string|null

Get the inline message for a rule if it exists.

Parameters

  • $attribute string
  • $lowerRule string
  • $source array|null
protected

getCustomMessageFromTranslator ( $key ) : string

Get the custom error message from the translator.

Parameters

  • $key string
protected

getWildcardCustomMessages ( $messages , $search , $default ) : string

Check the given messages for a wildcard key.

Parameters

  • $messages array
  • $search string
  • $default string
protected

getSizeMessage ( $attribute , $rule ) : string

Get the proper error message for an attribute and size rule.

Parameters

  • $attribute string
  • $rule string
protected

getAttributeType ( $attribute ) : string

Get the data type of the given attribute.

Parameters

  • $attribute string
public

makeReplacements ( $message , $attribute , $rule , $parameters ) : string

Replace all error message place-holders with actual values.

Parameters

  • $message string
  • $attribute string
  • $rule string
  • $parameters array
public

getDisplayableAttribute ( $attribute ) : string

Get the displayable name of the attribute.

Parameters

  • $attribute string
protected

getAttributeFromTranslations ( $name ) : string

Get the given attribute from the attribute translations.

Parameters

  • $name string
protected

replaceAttributePlaceholder ( $message , $value ) : string

Replace the :attribute placeholder in the given message.

Parameters

  • $message string
  • $value string
protected

replaceInputPlaceholder ( $message , $attribute ) : string

Replace the :input placeholder in the given message.

Parameters

  • $message string
  • $attribute string
public

getDisplayableValue ( $attribute , $value ) : string

Get the displayable name of the value.

Parameters

  • $attribute string
  • $value mixed
protected

getAttributeList ( array $values ) : array

Transform an array of attributes to their displayable form.

Parameters

  • $values array
protected

callReplacer ( $message , $attribute , $rule , $parameters , $validator ) : string|null

Call a custom validator message replacer.

Parameters

  • $message string
  • $attribute string
  • $rule string
  • $parameters array
  • $validator Validator
protected

callClassBasedReplacer ( $callback , $message , $attribute , $rule , $parameters , $validator ) : string

Call a class based validator message replacer.

Parameters

  • $callback string
  • $message string
  • $attribute string
  • $rule string
  • $parameters array
  • $validator Validator