Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/FormBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ private function isRadioOrCheckbox(): bool

private function getInputAttributes(): array
{
extract($this->get('render', 'type', 'multiple', 'name', 'size', 'placeholder', 'help', 'disabled', 'readonly', 'required', 'autocomplete', 'min', 'max', 'value', 'checked', 'formData', 'disableValidation', 'custom'));
extract($this->get('render', 'type', 'multiple', 'name', 'size', 'placeholder', 'help', 'disabled', 'readonly', 'required', 'autocomplete', 'min', 'max', 'value', 'checked', 'formData', 'disableValidation', 'custom', 'dusk'));

$isRadioOrCheckbox = $this->isRadioOrCheckbox();
$type = $isRadioOrCheckbox ? $render : $type;
Expand Down Expand Up @@ -279,7 +279,8 @@ private function getInputAttributes(): array
'aria-describedby' => $help ? 'help-' . $id : null,
'disabled' => $disabled,
'readonly' => $readonly,
'required' => $required
'required' => $required,
'dusk' => $dusk,
]);
}

Expand Down
7 changes: 7 additions & 0 deletions src/FormService.php
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,13 @@ public function attrs(array $attrs = []): FormService
{
return $this->_set('attrs', $attrs);
}

/**
* Set dusk attribute for an input
*/
public function dusk($duskAttribute): FormService {
return $this->_set('dusk', $duskAttribute);
}

/**
* Disable input states (valid and invalid classes) and error message
Expand Down