trait FormatsMessages

Traits

Methods

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

Replace all place-holders for the between rule.

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

Replace all place-holders for the date_format rule.

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

Replace all place-holders for the different rule.

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

Replace all place-holders for the digits rule.

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

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

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

Replace all place-holders for the min rule.

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

Replace all place-holders for the max rule.

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

Replace all place-holders for the in rule.

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

Replace all place-holders for the not_in rule.

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

Replace all place-holders for the in_array rule.

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

Replace all place-holders for the mimetypes rule.

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

Replace all place-holders for the mimes rule.

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

Replace all place-holders for the required_with rule.

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

Replace all place-holders for the required_with_all rule.

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

Replace all place-holders for the required_without rule.

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

Replace all place-holders for the required_without_all rule.

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

Replace all place-holders for the size rule.

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

Replace all place-holders for the required_if rule.

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

Replace all place-holders for the required_unless rule.

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

Replace all place-holders for the same rule.

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

Replace all place-holders for the before rule.

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

Replace all place-holders for the before_or_equal rule.

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

Replace all place-holders for the after rule.

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

Replace all place-holders for the after_or_equal rule.

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

Replace all place-holders for the dimensions rule.

string
getMessage(string $attribute, string $rule)

Get the validation message for an attribute and rule.

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
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

in ReplacesAttributes at line 18
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

in ReplacesAttributes at line 32
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

in ReplacesAttributes at line 46
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

in ReplacesAttributes at line 60
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

in ReplacesAttributes at line 74
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

in ReplacesAttributes at line 88
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

in ReplacesAttributes at line 102
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

in ReplacesAttributes at line 116
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

in ReplacesAttributes at line 134
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

in ReplacesAttributes at line 148
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

in ReplacesAttributes at line 162
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

in ReplacesAttributes at line 176
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

in ReplacesAttributes at line 190
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

in ReplacesAttributes at line 204
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

in ReplacesAttributes at line 218
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

in ReplacesAttributes at line 232
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

in ReplacesAttributes at line 246
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

in ReplacesAttributes at line 260
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

in ReplacesAttributes at line 278
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

in ReplacesAttributes at line 294
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

in ReplacesAttributes at line 308
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

in ReplacesAttributes at line 326
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

in ReplacesAttributes at line 340
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

in ReplacesAttributes at line 354
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

in ReplacesAttributes at line 368
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

at line 21
protected string getMessage(string $attribute, string $rule)

Get the validation message for an attribute and rule.

Parameters

string $attribute
string $rule

Return Value

string

at line 74
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

at line 98
protected string getCustomMessageFromTranslator(string $key)

Get the custom error message from translator.

Parameters

string $key

Return Value

string

at line 124
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

at line 142
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

at line 162
protected string getAttributeType(string $attribute)

Get the data type of the given attribute.

Parameters

string $attribute

Return Value

string

at line 187
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

at line 208
string getDisplayableAttribute(string $attribute)

Get the displayable name of the attribute.

Parameters

string $attribute

Return Value

string

at line 247
protected string getAttributeFromTranslations(string $name)

Get the given attribute from the attribute translations.

Parameters

string $name

Return Value

string

at line 259
protected string replaceAttributePlaceholder(string $message, string $value)

Replace the :attribute placeholder in the given message.

Parameters

string $message
string $value

Return Value

string

at line 275
string getDisplayableValue(string $attribute, mixed $value)

Get the displayable name of the value.

Parameters

string $attribute
mixed $value

Return Value

string

at line 296
protected array getAttributeList(array $values)

Transform an array of attributes to their displayable form.

Parameters

array $values

Return Value

array

at line 320
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

at line 342
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