password = $password; } /** * Determine if the validation rule passes. * * @param string $attribute * @param mixed $value * @return bool */ public function passes($attribute, $value) { $email = $value; $password = $this->password; if (Auth::guard('admin')->attempt(['email' => $email, 'password' => $password])) { $data = Admin:: where('email', $email) ->whereIn('status', [1]) ->count(); if (!$data) { return false; } return true; } return false; } /** * Get the validation error message. * * @return string */ public function message() { return config('error_code.login_error'); } }