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
|ID | user_id | email |
...............................
| 1 | 101 | john@gmail.com |
...............................
| 2 | 102 | john@gmail.com |
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.
'email' => 'required|unique:email_list|email',
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
Edited After 3 Hours
I also add same question in the github as issue. A person is saying that i have to create own validation rule.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…