events->getById($eventId, false); $participationType = $event->firstParticipationTypeSlug(); $amount = $participationType === null ? new Amount(0, 'Euro') : $event->toResource()->calculateAmount( $participationType, 'standard', $event->start_date, $event->end_date, false ); return response()->json([ 'amount' => $amount->toString(), 'amountValue' => $amount->getAmount(), ]); } }