merge([ 'length' => $this->dec($this->length), 'diameter' => $this->dec($this->diameter), 'weight' => $this->dec($this->weight), 'h' => collect($this->h ?? [])->map(fn ($v) => $this->dec($v))->all(), 'eta' => collect($this->eta ?? [])->map(fn ($v) => $this->dec($v))->all(), ]); } public function rules(): array { return [ 'name' => ['required', 'string', 'max:128', Rule::unique('seg_pumps', 'PUP_NAME')->ignore($this->route('pump'))], 'manufacturer_id' => ['required', 'integer', 'exists:seg_manufacturers,MCF_ID'], 'length' => ['nullable', 'numeric'], 'diameter' => ['nullable', 'numeric'], 'weight' => ['nullable', 'numeric'], 'h' => ['nullable', 'array'], 'h.*' => ['nullable', 'numeric'], 'eta' => ['nullable', 'array'], 'eta.*' => ['nullable', 'numeric'], ]; } private function dec(mixed $v): ?string { return $v === null || $v === '' ? null : str_replace(',', '.', (string) $v); } }