'integer', 'max_databases' => 'integer', 'node_id' => 'integer', ]; /** * Validation rules to assign to this model. */ public static array $validationRules = [ 'name' => 'required|string|max:191', 'host' => 'required|string', 'port' => 'required|numeric|between:1,65535', 'username' => 'required|string|max:32', 'password' => 'nullable|string', 'node_id' => 'sometimes|nullable|integer|exists:nodes,id', ]; /** * Gets the node associated with a database host. */ public function node(): BelongsTo { return $this->belongsTo(Node::class); } /** * Gets the databases associated with this host. */ public function databases(): HasMany { return $this->hasMany(Database::class); } }