Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

roerjo's avatar
Level 19

Validation 'same' rule not working like I think it should.

Trying to figure out why the 'same' validation rule isn't working. Any ideas as to what I am doing wrong?

Code: alt text

Postman Result:

0 likes
4 replies
bunnypro's avatar
bunnypro
Best Answer
Level 7

same rule is for comparing the field value with the other field value

e.g.

[
    'one' => 'required',
    'two' => 'same:one'
]
1 like
roerjo's avatar
Level 19

@bunnypro ah...I was totally misinterpreting what it was supposed to do...thought it just compared a passed value to the field value.

Please or to participate in this conversation.