0
例如如何在下面的简单示例中添加例外$ id1和$ id2?Laravel 5.1。如何在“唯一”验证规则中添加多个例外情况?
class SomeFormInputRequest extends Request
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
$id1 = 1;
$id2 = 2
return [
'email' => 'email|unique:users,email,' . $id1,
];
}
}