mardi 20 septembre 2016

How to check if email already exist with id in laravel 5.2?

I have table in which i'm trying to store email addresses. These email addresses will be save with user_id.

For example

|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



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire