Overview of upcoming events

This commit is contained in:
2026-04-25 21:23:32 +02:00
parent f813056bf7
commit 8348f677a5
7 changed files with 108 additions and 8 deletions

View File

@@ -64,7 +64,14 @@ class EventResource extends JsonResource{
ParticipationType::PARTICIPATION_TYPE_VOLUNTEER,
ParticipationType::PARTICIPATION_TYPE_OTHER,
] as $participationType) {
$returnArray['participants'][$participationType] = $this->getParticipants($participationType);
$_t =$this->getParticipants($participationType);
$returnArray['participants'][$participationType] = $_t;
$returnArray['count' . ucfirst($participationType)] = $_t['count'];
}
$returnArray['nameShort'] = $returnArray['name'];
if (strlen($returnArray['nameShort']) > 15) {
$returnArray['nameShort'] = substr($returnArray['nameShort'], 8, 13) . '...';
}
$returnArray['costUnit'] = new CostUnitResource($this->event->costUnit()->first())->toArray(true);