attributes->withAdditional(['type' => 'text']); $attrArray = $attrs->toArray(); if ($this->value !== null && $this->value !== '') { $attrArray['value'] = (string) $this->value; } $input = FormElement::textInput($this->attributes->name(), $this->value !== null ? (string) $this->value : '') ->withId($this->attributes->id()) ->withClass($this->attributes->class()); if ($this->attributes->required()) { $input = $input->withRequired(); } if ($this->attributes->placeholder() !== null) { $input = $input->withAttribute('placeholder', $this->attributes->placeholder()); } $wrapped = $this->wrapper->wrap((string) $input, $this->metadata); return $form->addRawHtml($wrapped); } public function getName(): string { return $this->metadata->name; } public function getValue(): mixed { return $this->value; } public function getLabel(): string { return $this->metadata->label; } }