退会済じゃない会員の中でメールアドレスが一意であることをバリデーションしたい。
RegisterUserRequest.php
class RegisterUserRequest extends FormRequest
{
public function authorize()
{
return true;
}
public function rules()
{
return [
'email' => [
'required',
'email',
'confirmed',
Rule::unique('users')->ignore(false, 'canceled'),
],
];
}
public function messages()
{
return [
//
];
}
}