*/ public function toArray(Request $request): array { if ($this->resource instanceof IceCandidateDto) { return $this->resource->toArray(); } if (is_array($this->resource)) { return array_filter([ 'urls' => $this->resource['urls'] ?? $this->resource['url'] ?? null, 'username' => $this->resource['username'] ?? null, 'credential' => $this->resource['credential'] ?? $this->resource['password'] ?? null, 'credentialType' => $this->resource['credentialType'] ?? null, ], fn ($value) => $value !== null); } return (array) $this->resource; } }