Open luckcolors opened 2 years ago
The behaviour of confirmed is to simply add a copy of the field
That's the problem. It's adding another field. The rules we support currently just add information about an existing field. We could theoretically support this in future, but not any time soon.
Out of curiosity, what are you using a password confirmation field in an API for? That seems like something better suited for front-ends, where the password is masked (and even there, it's an anti-pattern). In an API, you're just having someone write duplicate code.
The reason was so the client can just directly map a form into the request without doing extra work.
But yeah i suppose i could do less with the validator or extra field.
Up to you if you think this should be implemented at some point.
Thanks for the quick reply. 😄
What happened? I'm using scribe to generate post requests for my app. It seems that when the confirmed validator gets used it's ignored as it's un supported, according to this list here. https://scribe.knuckles.wtf/laravel/documenting/query-body-parameters#supported-validation-rules).
The behaviour of confirmed is to simply add a copy of the field it's specified on with
_confirmed
appended to it in order to validate equality with the original one. [https://laravel.com/docs/9.x/validation#rule-confirmed]https://laravel.com/docs/9.x/validation#rule-confirmedSo what happens is that given the following example of a register post request:
Generated scribe request:
The generated request lacks the "password_confirmation" field.
My environment:
php -v
): v8.1.4composer show laravel/framework
orcomposer show laravel/lumen-framework
): v9.27.0composer show knuckleswtf/scribe
): v3.37.1My Scribe config (minus the comments): defaults