Skip to content

Conversation

AhmedAlaa4611
Copy link
Contributor

Continuation of: #56794


Description

This PR refactors several validation message replacer methods that shared the same logic:

  • replaceMissingUnless()
  • replacePresentUnless()

Instead of duplicating the same code, these methods now delegate to the existing replaceMissingUnless() implementation.

This follows the same approach already used in replaceNotIn(), where the logic is centralized in one method and other similar methods simply call it.

protected function replaceNotIn($message, $attribute, $rule, $parameters)
{
return $this->replaceIn($message, $attribute, $rule, $parameters);
}

This change reduces code duplication and makes the code easier to maintain.

@taylorotwell taylorotwell merged commit a8b554d into laravel:12.x Aug 27, 2025
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants