eventParticipants->getByIdentifier($participantIdentifier, $this->events); if ($participant === null) { abort(403, 'Zugriff verweigert.'); } $invoiceRequest = new CreateParticipantInvoiceRequest($participant); $invoiceCommand = new CreateParticipantInvoiceCommand($invoiceRequest); $invoiceResponse = $invoiceCommand->execute(); if (!$invoiceResponse->success) { abort(422, $invoiceResponse->message ?? 'Die Rechnung konnte nicht erstellt werden.'); } return response($invoiceResponse->pdfContent, 200, [ 'Content-Type' => 'application/pdf', 'Content-Disposition' => 'attachment; filename="' . $invoiceResponse->filename . '"', ]); } }