From f998df6a2abaa211a730f247ce814f238228fb70 Mon Sep 17 00:00:00 2001 From: Sam Light Date: Tue, 10 Feb 2026 01:01:10 +0000 Subject: Basic toolbar button --- src/Toolbar/Button.php | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/Toolbar/Button.php (limited to 'src/Toolbar/Button.php') diff --git a/src/Toolbar/Button.php b/src/Toolbar/Button.php new file mode 100644 index 0000000..92b041f --- /dev/null +++ b/src/Toolbar/Button.php @@ -0,0 +1,51 @@ +action = $action; + + return $this; + } + + public function slot(string $slot): static + { + $this->slot = $slot; + + return $this; + } + + private function makeAttributes(): ComponentAttributeBag + { + return $this->getAttributes()->merge([ + 'wire:click' => $this->action, + ]); + } + + public function render(): View + { + return view( + 'laralight-tables::toolbar.button', + [ + 'action' => $this->action, + 'attributes' => $this->makeAttributes(), + 'slot' => $this->slot, + ] + ); + } +} -- cgit v1.2.3