Skip to content

Commit

Permalink
Use displayableValue when replacing :value for lt/lte/gt/gte rules
Browse files Browse the repository at this point in the history
  • Loading branch information
rgehan committed Aug 24, 2019
1 parent 9f0c04d commit dec7139
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Concerns/ReplacesAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ protected function replaceSize($message, $attribute, $rule, $parameters)
protected function replaceGt($message, $attribute, $rule, $parameters)
{
if (is_null($value = $this->getValue($parameters[0]))) {
return str_replace(':value', $parameters[0], $message);
return str_replace(':value', $this->getDisplayableAttribute($parameters[0]), $message);
}

return str_replace(':value', $this->getSize($attribute, $value), $message);
Expand All @@ -278,7 +278,7 @@ protected function replaceGt($message, $attribute, $rule, $parameters)
protected function replaceLt($message, $attribute, $rule, $parameters)
{
if (is_null($value = $this->getValue($parameters[0]))) {
return str_replace(':value', $parameters[0], $message);
return str_replace(':value', $this->getDisplayableAttribute($parameters[0]), $message);
}

return str_replace(':value', $this->getSize($attribute, $value), $message);
Expand All @@ -296,7 +296,7 @@ protected function replaceLt($message, $attribute, $rule, $parameters)
protected function replaceGte($message, $attribute, $rule, $parameters)
{
if (is_null($value = $this->getValue($parameters[0]))) {
return str_replace(':value', $parameters[0], $message);
return str_replace(':value', $this->getDisplayableAttribute($parameters[0]), $message);
}

return str_replace(':value', $this->getSize($attribute, $value), $message);
Expand All @@ -314,7 +314,7 @@ protected function replaceGte($message, $attribute, $rule, $parameters)
protected function replaceLte($message, $attribute, $rule, $parameters)
{
if (is_null($value = $this->getValue($parameters[0]))) {
return str_replace(':value', $parameters[0], $message);
return str_replace(':value', $this->getDisplayableAttribute($parameters[0]), $message);
}

return str_replace(':value', $this->getSize($attribute, $value), $message);
Expand Down

0 comments on commit dec7139

Please sign in to comment.