blob: 7adc47a62dc27c265018b0e18145e769eb1ca61b (
plain)
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
37
38
39
40
41
42
43
44
45
46
|
<?php
namespace Lightscale\LaralightTables\Toolbar;
use Lightscale\LaralightTables\Concerns\WithAttributes;
use Illuminate\View\View;
class SelectFilter extends Filter
{
use WithAttributes;
/**
* @var iterable<string, string>
*/
protected iterable $options;
protected ?string $placeholder = null;
public function placeholder(?string $v): static
{
$this->placeholder = $v;
return $this;
}
/**
* @param iterable<string, string> $options
*/
public function options(iterable $options): static
{
$this->options = $options;
return $this;
}
public function render(): View
{
return view('laralight-tables::toolbar.select-filter', [
'id' => $this->makeId(),
'key' => $this->key,
'label' => $this->label,
'options' => $this->options,
'placeholder' => $this->placeholder,
'attributes' => $this->getAttributes(),
]);
}
}
|