Skip to content

Commit

Permalink
[10.x] Validation message placeholder is not getting replaced (larave…
Browse files Browse the repository at this point in the history
  • Loading branch information
Sohel Rana committed Jan 26, 2024
1 parent 882fed2 commit 13b2fad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Illuminate/Validation/Rules/Password.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down

0 comments on commit 13b2fad

Please sign in to comment.