Skip to content

Commit

Permalink
Add separator field
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-alrek committed Feb 27, 2023
1 parent c0d931f commit 060ce9f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Apility/Forms/Concerns/BuildsFormFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function withName(string $name)
*/
public function withType(string $type)
{
if (in_array($type, ['checkbox', 'date', 'email', 'hidden', 'label', 'number', 'password', 'phone', 'select', 'text', 'textarea', 'file', 'image'])) {
if (in_array($type, ['checkbox', 'date', 'email', 'hidden', 'label', 'number', 'password', 'phone', 'select', 'text', 'textarea', 'file', 'image', 'separator'])) {
$this->attributes['type'] = $type;

return $this;
Expand Down Expand Up @@ -316,6 +316,12 @@ public static function label($label)
->withLabel($label);
}

public static function separator()
{
return static::make()
->withType('separator');
}

/**
* @param string $name
* @param string|HtmlString|null $label
Expand Down

0 comments on commit 060ce9f

Please sign in to comment.