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

[11.x] Add optional parameter for confirmed validator rule #52722

Merged
merged 2 commits into from
Sep 10, 2024

Conversation

jwpage
Copy link
Contributor

@jwpage jwpage commented Sep 10, 2024

This adds an optional parameter for the confirmed validator rule, allowing for more customization.

For example, you could do "password" => "confirmed:passwordConfirmation" if your front-end coding style required camelCase.

Providing no parameter results in the current behavior of checking the default naming convention, ie. "password" => "confirmed" checks password_confirmation.

The same behavior can be achieved with "passwordConfirmation" => "same:password" but I believe this better describes the intent of the validation by associating the confirmation with the original field, along with any other password rules that may be required.

@jwpage jwpage changed the title Add optional parameter for confirmed validator rule [11.x] Add optional parameter for confirmed validator rule Sep 10, 2024
@taylorotwell taylorotwell merged commit 15cf063 into laravel:11.x Sep 10, 2024
31 checks passed
@shaedrich
Copy link

shaedrich commented Sep 15, 2024

Couldn't the casing instead/additionally be a general configuration value so it could potentially used by other rules as well?

@christophrumpel
Copy link
Contributor

This would be nice to have in the docs.

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.

4 participants