diff --git a/src/Illuminate/Validation/Rules/Password.php b/src/Illuminate/Validation/Rules/Password.php index 588f357334cc..a1f41efdb3c1 100644 --- a/src/Illuminate/Validation/Rules/Password.php +++ b/src/Illuminate/Validation/Rules/Password.php @@ -321,6 +321,10 @@ public function passes($attribute, $value) } if ($this->max && mb_strlen($value) > $this->max) { + $validator->addReplacer('max.string', function ($message, $attribute, $rule, $parameters, $validator) { + return str_replace(':max', $validator->getDisplayableAttribute($this->max), $message); + }); + $validator->addFailure($attribute, 'max.string'); }