-
Notifications
You must be signed in to change notification settings - Fork 554
/
Select.php
36 lines (29 loc) · 874 Bytes
/
Select.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
namespace A17\Twill\Services\Forms\Fields;
use A17\Twill\Services\Forms\Fields\Traits\HasOptions;
use A17\Twill\Services\Forms\Fields\Traits\HasPlaceholder;
use A17\Twill\Services\Forms\Fields\Traits\IsTranslatable;
use A17\Twill\Services\Forms\Fields\Traits\Unpackable;
class Select extends BaseFormField
{
use IsTranslatable;
use HasOptions;
use HasPlaceholder;
use Unpackable;
protected bool $searchable = false;
public static function make(): static
{
return new self(
component: \A17\Twill\View\Components\Fields\Select::class,
mandatoryProperties: ['name', 'label', 'options']
);
}
/**
* If the options should be searchable.
*/
public function searchable(bool $searchable = true): static
{
$this->searchable = $searchable;
return $this;
}
}