[ [ 'code' => 'HttpException', 'status' => '500', 'detail' => 'Unable to send mail using the configured transport.', ], ], ]; /** * Send test mail message. */ #[Endpoint('Send test mail', 'Sends a test email to the authenticated administrator using the configured mail transport.')] #[ScribeResponse(status: 204, description: 'Test mail queued.')] #[ScribeResponse(self::MAIL_ERROR, status: 500, description: 'The configured mail transport failed to send the message.')] public function __invoke(SendTestMailRequest $request): Response { try { Notification::route('mail', $request->user()->email) ->notify(new MailTested($request->user())); } catch (Throwable $throwable) { throw new HttpException(Response::HTTP_INTERNAL_SERVER_ERROR, $throwable->getMessage(), $throwable); } return $this->returnNoContent(); } }