Back

Unique Validation based on user location


I need to register same user with same email address for different locations using unique validation rule.

My RegistrationForm rules are,

public function rules() { return [ 'name'=>'required', 'email'=>'required|email', 'location'=>'required|unique:users,email', 'password'=>'required|confirmed' ]; }

Tobias van Beek replied 1 week ago

Can you place the code between ` (Or use the code button in the text editor)

Where do you store the location to validate? You can add where statements to the query to validate, see the documentation about the unique rule: https://laravel.com/docs/5.6/validation#rule-unique

Sooryakumar replied 1 week ago

Found the solution,

Followed instructions from here.


Sign in to participate in this thread!



We'd like to thank these amazing companies for supporting us