🔧 Filter events to include only upcoming ones in calendar download

This commit is contained in:
HolgerHatGarKeineNode
2025-11-23 00:30:23 +01:00
parent 884b73211a
commit af7a05e44c

View File

@@ -22,7 +22,7 @@ class DownloadMeetupCalendar extends Controller
'meetupEvents.meetup',
])
->findOrFail($request->input('meetup'));
$events = $meetup->meetupEvents;
$events = $meetup->meetupEvents()->where('start', '>=', now())->get();
$image = $meetup->getFirstMediaUrl('logo');
} elseif ($request->has('my')) {
$ids = $request->input('my');
@@ -30,6 +30,7 @@ class DownloadMeetupCalendar extends Controller
->with([
'meetup',
])
->where('start', '>=', now())
->whereHas('meetup', fn($query) => $query->whereIn('meetups.id', $ids))
->get();
$image = asset('img/einundzwanzig-horizontal.png');
@@ -38,6 +39,7 @@ class DownloadMeetupCalendar extends Controller
->with([
'meetup',
])
->where('start', '>=', now())
->get();
$image = asset('img/einundzwanzig-horizontal.png');
}