Handling ICAL import

This commit is contained in:
2026-04-25 16:50:32 +02:00
parent 6f8be58943
commit 1ee6b9968f
22 changed files with 510 additions and 19 deletions

View File

@@ -0,0 +1,31 @@
<?php
namespace App\Domains\Event\Controllers;
use App\Domains\Event\Actions\GenerateIcal\GenerateIcalCommand;
use App\Domains\Event\Actions\GenerateIcal\GenerateIcalRequest;
use App\Models\EventParticipant;
use App\Scopes\CommonController;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
class ParticipantIcalController extends CommonController
{
public function __invoke(string $participantIdentifier, Request $request): Response
{
$participant = $this->eventParticipants->getMyParticipationByIdentifier($participantIdentifier);
if ($participant === null) {
abort(403, 'Zugriff verweigert.');
}
$icalRequest = new GenerateIcalRequest($participant);
$icalCommand = new GenerateIcalCommand($icalRequest);
$icalResponse = $icalCommand->execute();
return response($icalResponse->icalContent, 200, [
'Content-Type' => 'text/calendar; charset=utf-8',
'Content-Disposition' => 'attachment; filename="' . $icalResponse->filename . '"',
]);
}
}