Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add place-holder replacers for before_or_equal and after_or_equal rules #17027

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/Illuminate/Validation/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2608,6 +2608,20 @@ protected function replaceBefore($message, $attribute, $rule, $parameters)
return str_replace(':date', $parameters[0], $message);
}

/**
* Replace all place-holders for the before_or_equal rule.
*
* @param string $message
* @param string $attribute
* @param string $rule
* @param array $parameters
* @return string
*/
protected function replaceBeforeOrEqual($message, $attribute, $rule, $parameters)
{
return $this->replaceBefore($message, $attribute, $rule, $parameters);
}

/**
* Replace all place-holders for the after rule.
*
Expand All @@ -2622,6 +2636,20 @@ protected function replaceAfter($message, $attribute, $rule, $parameters)
return $this->replaceBefore($message, $attribute, $rule, $parameters);
}

/**
* Replace all place-holders for the after_or_equal rule.
*
* @param string $message
* @param string $attribute
* @param string $rule
* @param array $parameters
* @return string
*/
protected function replaceAfterOrEqual($message, $attribute, $rule, $parameters)
{
return $this->replaceBefore($message, $attribute, $rule, $parameters);
}

/**
* Get all attributes.
*
Expand Down