FormatsMessages is a modifier to the base trait, it implements some extended technology to allow rule objects to specify methods message() and replace() for custom messaging.

See Also

Public Methods

public makeReplacements()

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

makeReplacements replace all error message place-holders with actual values.

Protected Methods

protected callExtensionMethod()

protected callExtensionMethod($rule, $methodName, $args = []): string 

callExtensionMethod calls a method for an extended rule and returns the result as a string.

protected getMessage()

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

getMessage message for a validation attribute and rule.

protected hasExtensionMethod()

protected hasExtensionMethod($rule, $methodName): bool 

hasExtensionMethod determines if an extended rule has a given method.