request = $request; } /** * Get the error response associated with the given exception. * * @param \Exception $exception * @param string $id * @param int $code * @param string[] $headers * * @return \Symfony\Component\HttpFoundation\Response */ public function display(Exception $exception, string $id, int $code, array $headers) { return cachet_redirect('auth.login')->withError(trans('forms.login.rate-limit')); } /** * Get the supported content type. * * @return string */ public function contentType() { return 'text/html'; } /** * Can we display the exception? * * @param \Exception $original * @param \Exception $transformed * @param int $code * * @return bool */ public function canDisplay(Exception $original, Exception $transformed, int $code) { return $transformed instanceof TooManyRequestsHttpException && $this->request->is('auth*'); } /** * Do we provide verbose information about the exception? * * @return bool */ public function isVerbose() { return false; } }