summaryrefslogtreecommitdiff
path: root/workbench/app/Livewire
diff options
context:
space:
mode:
Diffstat (limited to 'workbench/app/Livewire')
-rw-r--r--workbench/app/Livewire/ProductsTable.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/workbench/app/Livewire/ProductsTable.php b/workbench/app/Livewire/ProductsTable.php
index c3e29a5..5469c7d 100644
--- a/workbench/app/Livewire/ProductsTable.php
+++ b/workbench/app/Livewire/ProductsTable.php
@@ -5,6 +5,7 @@ namespace Workbench\App\Livewire;
use Illuminate\Database\Eloquent\Builder;
use Lightscale\LaralightTables\Columns\Column;
use Lightscale\LaralightTables\Toolbar;
+use Lightscale\LaralightTables\Toolbar\Button;
use Lightscale\LaralightTables\Toolbar\ColumnSelect;
use Lightscale\LaralightTables\Toolbar\PageSize;
use Lightscale\LaralightTables\Toolbar\Search;
@@ -38,10 +39,22 @@ class ProductsTable extends Table
->appendStart(Search::make())
->appendStart($categoryFilter)
->appendEnd(PageSize::make())
- ->appendEnd(ColumnSelect::make()),
+ ->appendEnd(ColumnSelect::make())
+ ->appendEnd( Button::make()
+ ->attributes([
+ 'class'=> 'btn btn-primary'
+ ])
+ ->slot('HELLO')
+ ->action('sayHello()')
+ ),
];
}
+ public function sayHello(): void
+ {
+ $this->js("alert('HELLO')");
+ }
+
public function query(): Builder
{
return parent::query()