这是我的验证规则:
$validationCondition = array(
'fname' => 'required|min:2',
'lname' => 'required|min:2',
'email' => 'required|email|unique:users,email',
'isd' => 'required|unique:users,isd',
'mobile' => 'required',
'password' => 'required'
);
$validationMessages = array(
'fname.required' => 'Please provide first name',
'fname.min' => 'First name should be atleast 3 characters long',
'lname.required' => 'Please provide last name',
'lname.min' => 'Last name should be atleast 3 characters long',
'email.required' => 'Please provide email',
'email.email' => 'Please provide a valid email id',
'email.unique' => 'This email id has already been registered. Choose any other valid email id.',
'isd.required' => 'The city name should be atleast 3 characters long',
'mobile.required' => 'Please provide mobile number',
'password.required' => 'Please provide password'
);
在用户表中,需要检查 isd 和 mobile 两个字段,以确保联系电话号码的唯一性。
如何进行检查?我知道如何检查单个字段的唯一性,但不知道如何检查组合值的唯一性。