jeudi 22 juin 2017

Email unique in DB per Client

I am using laravel 5.4 with couchbase with php 7.1

In our system, one can create new users. Till now, the email field had to be unique to the database users-table, no problem, we used this in our request

'email'        => 'required|email|unique:users,email,NULL,user_id,datetime_deleted,NULL',

This was working fine. Now, we have a new request to our application that the email of an user has to be unique not to the whole user-table, but to one client, so we can have several times the same email address, but with differences in the 'client_id' field in the document.

How can i put this in my Request-Class?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2sTWxZS
via IFTTT

Aucun commentaire:

Enregistrer un commentaire