$this->string('name')->toString(), 'host' => $this->string('host')->toString(), 'port' => $this->integer('port'), 'username' => $this->string('username')->toString(), 'password' => $this->filled('password') ? $this->string('password')->toString() : null, 'node_id' => $this->filled('node_id') ? $this->integer('node_id') : null, ]; } /** Default an unsupplied node_id to null so the host is treated as global. */ protected function prepareForValidation(): void { if (! $this->filled('node_id')) { $this->merge(['node_id' => null]); } } }