Skip to content

Commit 35fd47a

Browse files
committed
[ADD] added setDisabled method
1 parent 93fadc2 commit 35fd47a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Inputs/BaseField.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ public function setRequired(bool $required = true, ?string $customValidationMess
5454
return $this;
5555
}
5656

57+
public function setDisabled(bool $isDisabled = true): static
58+
{
59+
if ($isDisabled) {
60+
$this->setHtmlAttribute('disabled', 'disabled');
61+
}
62+
63+
return $this;
64+
}
65+
5766
//////////////////////////////////////////////////////// Getters / Setters
5867

5968
public function getId(): ?string

0 commit comments

Comments
 (0)