summaryrefslogtreecommitdiff
path: root/src/Concerns
diff options
context:
space:
mode:
authorSam Light <samlight1994@gmail.com>2025-04-02 23:32:09 +0100
committerSam Light <samlight1994@gmail.com>2025-04-02 23:32:09 +0100
commitca5f3970675c39bd7173724e932bc48a13ff08df (patch)
treeaf9c88fa0ce43064e0957103a804a68c365d346c /src/Concerns
parent0a7e289c3c30e76d53548d496846b7582ade716f (diff)
Added attributes to SelectFilterHEADv1.1.0master
Diffstat (limited to 'src/Concerns')
-rw-r--r--src/Concerns/WithAttributes.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/Concerns/WithAttributes.php b/src/Concerns/WithAttributes.php
new file mode 100644
index 0000000..5b77fa5
--- /dev/null
+++ b/src/Concerns/WithAttributes.php
@@ -0,0 +1,22 @@
+<?php
+
+namespace Lightscale\LaralightTables\Concerns;
+
+use Illuminate\View\ComponentAttributeBag;
+
+trait WithAttributes
+{
+ protected ?array $attributes = null;
+
+ public function attributes(array $attributes): static
+ {
+ $this->attributes = $attributes;
+ return $this;
+ }
+
+ protected function getAttributes(): ComponentAttributeBag
+ {
+ return new ComponentAttributeBag($this->attributes ?? []);
+ }
+
+}