diff options
author | Sam Light <samlight1994@gmail.com> | 2025-03-30 14:20:57 +0100 |
---|---|---|
committer | Sam Light <samlight1994@gmail.com> | 2025-03-30 14:20:57 +0100 |
commit | e744b8d67ef1d18050158dd523ba7d804c1c8528 (patch) | |
tree | 56c90a83912bd63bdd507e76e5ef00c82a904b50 /src/Toolbar/SelectFilter.php | |
parent | a883170dd1c723bcd02916f9bc8a96ed85a61761 (diff) |
Filters, sorting, escaping and more....
Diffstat (limited to 'src/Toolbar/SelectFilter.php')
-rw-r--r-- | src/Toolbar/SelectFilter.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/Toolbar/SelectFilter.php b/src/Toolbar/SelectFilter.php new file mode 100644 index 0000000..0549885 --- /dev/null +++ b/src/Toolbar/SelectFilter.php @@ -0,0 +1,35 @@ +<?php + +namespace Lightscale\LaralightTables\Toolbar; + +use Illuminate\View\View; + +class SelectFilter extends Filter +{ + protected iterable $options; + protected ?string $placeholder = null; + + public function placeholder(?string $v): static + { + $this->placeholder = $v; + return $this; + } + + 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, + ]); + } + +} |