mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2025-12-14 12:06:46 +00:00
🔧 Filter events to include only upcoming ones in calendar download
This commit is contained in:
@@ -22,7 +22,7 @@ class DownloadMeetupCalendar extends Controller
|
|||||||
'meetupEvents.meetup',
|
'meetupEvents.meetup',
|
||||||
])
|
])
|
||||||
->findOrFail($request->input('meetup'));
|
->findOrFail($request->input('meetup'));
|
||||||
$events = $meetup->meetupEvents;
|
$events = $meetup->meetupEvents()->where('start', '>=', now())->get();
|
||||||
$image = $meetup->getFirstMediaUrl('logo');
|
$image = $meetup->getFirstMediaUrl('logo');
|
||||||
} elseif ($request->has('my')) {
|
} elseif ($request->has('my')) {
|
||||||
$ids = $request->input('my');
|
$ids = $request->input('my');
|
||||||
@@ -30,6 +30,7 @@ class DownloadMeetupCalendar extends Controller
|
|||||||
->with([
|
->with([
|
||||||
'meetup',
|
'meetup',
|
||||||
])
|
])
|
||||||
|
->where('start', '>=', now())
|
||||||
->whereHas('meetup', fn($query) => $query->whereIn('meetups.id', $ids))
|
->whereHas('meetup', fn($query) => $query->whereIn('meetups.id', $ids))
|
||||||
->get();
|
->get();
|
||||||
$image = asset('img/einundzwanzig-horizontal.png');
|
$image = asset('img/einundzwanzig-horizontal.png');
|
||||||
@@ -38,6 +39,7 @@ class DownloadMeetupCalendar extends Controller
|
|||||||
->with([
|
->with([
|
||||||
'meetup',
|
'meetup',
|
||||||
])
|
])
|
||||||
|
->where('start', '>=', now())
|
||||||
->get();
|
->get();
|
||||||
$image = asset('img/einundzwanzig-horizontal.png');
|
$image = asset('img/einundzwanzig-horizontal.png');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user