Skip to content

Commit f2f7048

Browse files
committed
Merge pull request laravel#1563 from rhwilrForks/master
Fix typo
2 parents f7faea2 + 8d327c4 commit f2f7048

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

validation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ Occasionally, you may need to set a custom connection for database queries made
670670

671671
**Forcing A Unique Rule To Ignore A Given ID:**
672672

673-
Sometimes, you may wish to ignore a given ID during the unique check. For example, consider an "update profile" screen that includes the user's name, e-mail address, and location. Of course, you will want to verify that the e-mail address is unique. However, if the user only changes the name field and not the e-mail field, you do not want a validation error to be thrown because the user is already the owner of the e-mail address. You only want to throw a validation error if the user provides an e-mail address that is already by a different user. To tell the unique rule to ignore the user's ID, you may pass the ID as the third parameter:
673+
Sometimes, you may wish to ignore a given ID during the unique check. For example, consider an "update profile" screen that includes the user's name, e-mail address, and location. Of course, you will want to verify that the e-mail address is unique. However, if the user only changes the name field and not the e-mail field, you do not want a validation error to be thrown because the user is already the owner of the e-mail address. You only want to throw a validation error if the user provides an e-mail address that is already used by a different user. To tell the unique rule to ignore the user's ID, you may pass the ID as the third parameter:
674674

675675
'email' => 'unique:users,email_address,'.$user->id
676676

0 commit comments

Comments
 (0)