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

[5.8] Use custom attributes in lt/lte/gt/gte rules messages #29716

Merged
merged 2 commits into from
Aug 24, 2019

Conversation

rgehan
Copy link
Contributor

@rgehan rgehan commented Aug 24, 2019

This PR fixes #29441

Consider these rules:

$rules = [
  'min' => 'numeric',
  'max' => 'numeric|gt:min,
];

And these custom attributes:

$customAttributes = [
  'min' => 'minimum value',
  'max' => 'maximum value',
];

With the following data:

$data = [
  'max' => 10,
];

Validation fails, with the following error message: The maximum value must be greater than min.

It completely ignored the custom attribute defined for max, and the message should be: The maximum value must be greater than minimum value.

@taylorotwell taylorotwell merged commit 7725e7a into laravel:5.8 Aug 24, 2019
@tillkruss
Copy link
Contributor

Thanks @rgehan!

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.

lte/gte/gt/lt not using custom attribute labels
3 participants