summaryrefslogtreecommitdiff
path: root/src/Toolbar/SelectFilter.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Toolbar/SelectFilter.php')
-rw-r--r--src/Toolbar/SelectFilter.php35
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,
+ ]);
+ }
+
+}