From 536fa6c917d63b14feeb8f876e6a1d62acb577fc Mon Sep 17 00:00:00 2001 From: Sam Light Date: Thu, 12 Feb 2026 00:23:02 +0000 Subject: Created new dropdown toolbar item --- src/Toolbar/Concerns/WithAttributes.php | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/Toolbar/Concerns/WithAttributes.php (limited to 'src/Toolbar/Concerns/WithAttributes.php') diff --git a/src/Toolbar/Concerns/WithAttributes.php b/src/Toolbar/Concerns/WithAttributes.php new file mode 100644 index 0000000..3a37282 --- /dev/null +++ b/src/Toolbar/Concerns/WithAttributes.php @@ -0,0 +1,36 @@ + + */ + protected ?array $attributes = null; + + /** + * @param array $attributes + */ + public function attributes(array $attributes): static + { + $this->attributes = $attributes; + + return $this; + } + + /** + * @param array $merge + */ + protected function getAttributes(array $merge = []): ComponentAttributeBag + { + return new ComponentAttributeBag([ + ...$merge, + ...($this->attributes ?? []), + ]); + } +} -- cgit v1.2.3