Skip to content

Commit f2fad10

Browse files
Adds replaceNotStartsWith function
1 parent 9f4eb34 commit f2fad10

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/Illuminate/Validation/Concerns/ReplacesAttributes.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,4 +627,22 @@ protected function replaceStartsWith($message, $attribute, $rule, $parameters)
627627

628628
return str_replace(':values', implode(', ', $parameters), $message);
629629
}
630+
631+
/**
632+
* Replace all place-holders for the not_starts_with rule.
633+
*
634+
* @param string $message
635+
* @param string $attribute
636+
* @param string $rule
637+
* @param array<int,string> $parameters
638+
* @return string
639+
*/
640+
protected function replaceNotStartsWith($message, $attribute, $rule, $parameters)
641+
{
642+
foreach ($parameters as &$parameter) {
643+
$parameter = $this->getDisplayableValue($attribute, $parameter);
644+
}
645+
646+
return str_replace(':values', implode(', ', $parameters), $message);
647+
}
630648
}

0 commit comments

Comments
 (0)