*/ public function toArray(Request $request): array { $rowService = app(AdminAppTicketRowService::class); $details = $rowService->details($this->resource); return [ ...parent::toArray($request), ...$details, 'allow_refund' => $this->resource->allow_refund(), 'is_active' => $this->resource->is_active(), 'can_cancel' => $this->resource->can_cancel(), 'can_refund' => $this->resource->can_refund(), 'refund' => $this->resource->refund === null ? null : [ 'type' => $this->resource->refund->type, 'type_label' => $this->resource->refund->typeLabel(), 'amount' => $this->resource->refund->amount, 'created_at' => $this->resource->refund->created_at, 'created_by' => $this->resource->refund->createdBy?->nombre_apellido, ], 'values' => $rowService->values($this->resource, $details), ]; } }