W3cubDocs

/Laravel 5.8

FormatsMessages

trait FormatsMessages (View source)

Traits

ReplacesAttributes

Methods

string replaceBetween(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the between rule.

from ReplacesAttributes
string replaceDateFormat(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the date_format rule.

from ReplacesAttributes
string replaceDifferent(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the different rule.

from ReplacesAttributes
string replaceDigits(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the digits rule.

from ReplacesAttributes
string replaceDigitsBetween(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the digits (between) rule.

from ReplacesAttributes
string replaceMin(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the min rule.

from ReplacesAttributes
string replaceMax(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the max rule.

from ReplacesAttributes
string replaceIn(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the in rule.

from ReplacesAttributes
string replaceNotIn(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the not_in rule.

from ReplacesAttributes
string replaceInArray(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the in_array rule.

from ReplacesAttributes
string replaceMimetypes(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the mimetypes rule.

from ReplacesAttributes
string replaceMimes(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the mimes rule.

from ReplacesAttributes
string replaceRequiredWith(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the required_with rule.

from ReplacesAttributes
string replaceRequiredWithAll(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the required_with_all rule.

from ReplacesAttributes
string replaceRequiredWithout(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the required_without rule.

from ReplacesAttributes
string replaceRequiredWithoutAll(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the required_without_all rule.

from ReplacesAttributes
string replaceSize(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the size rule.

from ReplacesAttributes
string replaceGt(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the gt rule.

from ReplacesAttributes
string replaceLt(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the lt rule.

from ReplacesAttributes
string replaceGte(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the gte rule.

from ReplacesAttributes
string replaceLte(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the lte rule.

from ReplacesAttributes
string replaceRequiredIf(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the required_if rule.

from ReplacesAttributes
string replaceRequiredUnless(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the required_unless rule.

from ReplacesAttributes
string replaceSame(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the same rule.

from ReplacesAttributes
string replaceBefore(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the before rule.

from ReplacesAttributes
string replaceBeforeOrEqual(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the before_or_equal rule.

from ReplacesAttributes
string replaceAfter(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the after rule.

from ReplacesAttributes
string replaceAfterOrEqual(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the after_or_equal rule.

from ReplacesAttributes
string replaceDateEquals(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the date_equals rule.

from ReplacesAttributes
string replaceDimensions(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the dimensions rule.

from ReplacesAttributes
string replaceEndsWith(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the ends_with rule.

from ReplacesAttributes
string replaceStartsWith(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the starts_with rule.

from ReplacesAttributes
string getMessage(string $attribute, string $rule)

Get the validation message for an attribute and rule.

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

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

string|null getFromLocalArray(string $attribute, string $lowerRule, array|null $source = null)

Get the inline message for a rule if it exists.

string getCustomMessageFromTranslator(string $key)

Get the custom error message from translator.

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

Check the given messages for a wildcard key.

string getSizeMessage(string $attribute, string $rule)

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

string getAttributeType(string $attribute)

Get the data type of the given attribute.

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

Replace all error message place-holders with actual values.

string getDisplayableAttribute(string $attribute)

Get the displayable name of the attribute.

string getAttributeFromTranslations(string $name)

Get the given attribute from the attribute translations.

string replaceAttributePlaceholder(string $message, string $value)

Replace the :attribute placeholder in the given message.

string replaceInputPlaceholder(string $message, string $attribute)

Replace the :input placeholder in the given message.

string getDisplayableValue(string $attribute, mixed $value)

Get the displayable name of the value.

array getAttributeList(array $values)

Transform an array of attributes to their displayable form.

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

Call a custom validator message replacer.

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

Call a class based validator message replacer.

Details

protected string replaceBetween(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the between rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceDateFormat(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the date_format rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceDifferent(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the different rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceDigits(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the digits rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceDigitsBetween(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the digits (between) rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceMin(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the min rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceMax(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the max rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceIn(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the in rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceNotIn(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the not_in rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceInArray(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the in_array rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceMimetypes(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the mimetypes rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceMimes(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the mimes rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceRequiredWith(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the required_with rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceRequiredWithAll(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the required_with_all rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceRequiredWithout(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the required_without rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceRequiredWithoutAll(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the required_without_all rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceSize(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the size rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceGt(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the gt rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceLt(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the lt rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceGte(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the gte rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceLte(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the lte rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceRequiredIf(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the required_if rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceRequiredUnless(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the required_unless rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceSame(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the same rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceBefore(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the before rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceBeforeOrEqual(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the before_or_equal rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceAfter(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the after rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceAfterOrEqual(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the after_or_equal rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceDateEquals(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the date_equals rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceDimensions(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the dimensions rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceEndsWith(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the ends_with rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string replaceStartsWith(string $message, string $attribute, string $rule, array $parameters)

Replace all place-holders for the starts_with rule.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

protected string getMessage(string $attribute, string $rule)

Get the validation message for an attribute and rule.

Parameters

string $attribute
string $rule

Return Value

string

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

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

Parameters

string $attribute
string $rule

Return Value

string|null

protected string|null getFromLocalArray(string $attribute, string $lowerRule, array|null $source = null)

Get the inline message for a rule if it exists.

Parameters

string $attribute
string $lowerRule
array|null $source

Return Value

string|null

protected string getCustomMessageFromTranslator(string $key)

Get the custom error message from translator.

Parameters

string $key

Return Value

string

protected string getWildcardCustomMessages(array $messages, string $search, string $default)

Check the given messages for a wildcard key.

Parameters

array $messages
string $search
string $default

Return Value

string

protected string getSizeMessage(string $attribute, string $rule)

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

Parameters

string $attribute
string $rule

Return Value

string

protected string getAttributeType(string $attribute)

Get the data type of the given attribute.

Parameters

string $attribute

Return Value

string

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

Replace all error message place-holders with actual values.

Parameters

string $message
string $attribute
string $rule
array $parameters

Return Value

string

string getDisplayableAttribute(string $attribute)

Get the displayable name of the attribute.

Parameters

string $attribute

Return Value

string

protected string getAttributeFromTranslations(string $name)

Get the given attribute from the attribute translations.

Parameters

string $name

Return Value

string

protected string replaceAttributePlaceholder(string $message, string $value)

Replace the :attribute placeholder in the given message.

Parameters

string $message
string $value

Return Value

string

protected string replaceInputPlaceholder(string $message, string $attribute)

Replace the :input placeholder in the given message.

Parameters

string $message
string $attribute

Return Value

string

string getDisplayableValue(string $attribute, mixed $value)

Get the displayable name of the value.

Parameters

string $attribute
mixed $value

Return Value

string

protected array getAttributeList(array $values)

Transform an array of attributes to their displayable form.

Parameters

array $values

Return Value

array

protected string|null callReplacer(string $message, string $attribute, string $rule, array $parameters, Validator $validator)

Call a custom validator message replacer.

Parameters

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

Return Value

string|null

protected string callClassBasedReplacer(string $callback, string $message, string $attribute, string $rule, array $parameters, Validator $validator)

Call a class based validator message replacer.

Parameters

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

Return Value

string

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.8/Illuminate/Validation/Concerns/FormatsMessages.html