rut, 0, ',', '.'), $this->dv ]); } public function nombreCompleto(): string { return implode(' ', [ $this->nombres, implode(' ', $this->apellidos) ]); } public function jsonSerialize(): mixed { return array_merge([ 'rut' => $this->rut, 'dv' => $this->dv, 'rut_formateado' => $this->rut(), 'nombres' => $this->nombres, 'apellidos' => $this->apellidos, 'nombre_completo' => $this->nombreCompleto(), ], $this->datos->jsonSerialize(), [ 'representante' => $this->representante ?? '', 'otro' => $this->otro ?? '' ]); } }