eventParticipants->getMyParticipationByIdentifier($participantIdentifier); if ($participant === null) { abort(403, 'Zugriff verweigert.'); } $icalRequest = new GenerateIcalForDeadlineRequest($participant->event()->first()); $icalCommand = new GenerateIcalForDeadlineCommand($icalRequest); $icalResponse = $icalCommand->execute(); return response($icalResponse->icalContent, 200, [ 'Content-Type' => 'text/calendar; charset=utf-8', 'Content-Disposition' => 'attachment; filename="' . $icalResponse->filename . '"', ]); } }