resource->toArray()` als Basis wie in {@see EventParticipantResource}: die * Bankverbindung darf nur dorthin, wo sie hingehört (Beleg und Auszahlung), nicht in jede * Teilnehmerliste. Deshalb werden die Felder hier einzeln aufgeführt. */ class ParticipantRefundResource extends JsonResource { public function __construct(ParticipantRefund $refund) { parent::__construct($refund); } public function toArray($request): array { return [ 'token' => $this->resource->token, 'status' => $this->resource->status, 'amount' => $this->resource->amount?->toString() ?? '0,00 Euro', 'amountValue' => $this->resource->amount?->getAmount() ?? 0.0, 'reason' => $this->resource->reason, 'reasonLabel' => $this->resource->reasonLabel(), 'reasonNote' => $this->resource->reason_note, 'releasedAt' => $this->resource->released_at?->format('d.m.Y'), 'acceptedAt' => $this->resource->accepted_at?->format('d.m.Y'), 'cancelledAt' => $this->resource->cancelled_at?->format('d.m.Y'), // Die Abrechnung, über die ausgezahlt wird -- ihr Status ist der Auszahlungsstand. 'invoiceNumber' => $this->resource->invoice()->first()?->invoice_number, ]; } }