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
Forcing A Unique Rule To Ignore A Given ID #15518
Comments
|
@themsaid What value has $user->is ? |
Replace I'm closing since this is not a bug report, however feel free to ask on the forums or ping me if you need further help. |
@themsaid i'm not validating with primary id as you can see in the table |
You example was correct then:
|
@themsaid yes that's why i'm asking here, because when i'm trying to add same email (john@gmail.com) with user_id = 105 then its return an error
However it should not return error because i'm adding with different user_id. And when i'm passing same id like
Then it is return below error
|
You're ignoring |
@themsaid Aaahhhh... it's means i have to mentioned all exist id's as well ? |
I don't think you can ignore multiple IDs, only 1. I guess you'll need to create your own validation rule. |
@themsaid Thank you so much, i'm going to try. If you have time then kindly Save My Time, I would like to appreciate. 👍 |
Description:
I have table in which i'm trying to store email addresses. These email addresses will be save with user_id.
For example in email_list table
In above table you can see same email addresses save with different user_id, that's it what i'm trying to do.
Currently i'm trying simple laravel validation like this.
So is there any way to check already exist email addresses if row has same user_id? I'm using laravel 5.2. I would like to appreciate if someone guide me. Thank you
Steps To Reproduce:
The text was updated successfully, but these errors were encountered: