Add attendee count helpers and enhance Meetup API responses

-  Introduce `attendeesCount` and `mightAttendeesCount` methods in `MeetupEvent` model for cleaner attendee calculations.
- 🛠️ Refactor API responses to use attendee count helpers in `Meetup` and `MeetupEventController`.
- 🧪 Update tests to validate JSON structure with attendee-related fields (`id`, `attendees`, `might_attendees`).
This commit is contained in:
HolgerHatGarKeineNode
2026-06-15 22:45:28 +02:00
parent 0a1d177fc4
commit c3028b8260
4 changed files with 23 additions and 5 deletions
+2 -2
View File
@@ -272,8 +272,8 @@ class Meetup extends Model implements HasMedia
'location' => $nextEvent->location,
'description' => $nextEvent->description,
'link' => $nextEvent->link,
'attendees' => count($nextEvent->attendees ?? []),
'might_attendees' => count($nextEvent->might_attendees ?? []),
'attendees' => $nextEvent->attendeesCount(),
'might_attendees' => $nextEvent->mightAttendeesCount(),
'nostr_note' => str($nextEvent->nostr_status)->after('Sent event ')->before(' to '),
] : null,
);