EventResource::collection( Event::query()->upcoming()->limit(200)->get() ), ]); } public function show(Event $event): Response { abort_unless($event->is_published, 404); return Inertia::render('Events/Show', [ 'event' => [ ...(new EventResource($event))->resolve(), 'description_html' => $event->description_html, ], ]); } public function ics(Event $event, Calendar $calendar, Branding $branding): HttpResponse { abort_unless($event->is_published, 404); return response($calendar->toIcs($event, $branding->portalName()), 200, [ 'Content-Type' => 'text/calendar; charset=utf-8', 'Content-Disposition' => 'attachment; filename="termin-'.$event->id.'.ics"', ]); } }