Skip to content

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
@shaedrich
Copy link
Contributor

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

4 participants