summaryrefslogtreecommitdiff
path: root/workbench/app/Livewire
diff options
context:
space:
mode:
authorSam Light <samlight1994@gmail.com>2025-04-02 23:18:08 +0100
committerSam Light <samlight1994@gmail.com>2025-04-02 23:18:08 +0100
commit40607777a5752523f6750312675db09665726a5f (patch)
tree61004cf8148cb9e57bec12a5e92a2b352fc1528b /workbench/app/Livewire
parent350dc0827e0ff9e4f47c2df23187a35e8a8cf58b (diff)
Switch to allow multiple toolbars
Diffstat (limited to 'workbench/app/Livewire')
-rw-r--r--workbench/app/Livewire/ProductsTable.php14
-rw-r--r--workbench/app/Livewire/Table.php5
2 files changed, 8 insertions, 11 deletions
diff --git a/workbench/app/Livewire/ProductsTable.php b/workbench/app/Livewire/ProductsTable.php
index 1ae33be..9f06770 100644
--- a/workbench/app/Livewire/ProductsTable.php
+++ b/workbench/app/Livewire/ProductsTable.php
@@ -18,7 +18,7 @@ class ProductsTable extends Table
{
protected $model = Product::class;
- public function toolbar(): Toolbar
+ public function toolbars(): array
{
$categoryFilter = SelectFilter::make('category')
->placeholder(__('Filter category'))
@@ -30,11 +30,13 @@ class ProductsTable extends Table
)
);
- return parent::toolbar()
- ->appendStart(Search::make())
- ->appendStart($categoryFilter)
- ->appendEnd(PageSize::make())
- ->appendEnd(ColumnSelect::make());
+ return [
+ Toolbar::make($this)
+ ->appendStart(Search::make())
+ ->appendStart($categoryFilter)
+ ->appendEnd(PageSize::make())
+ ->appendEnd(ColumnSelect::make()),
+ ];
}
public function query(): Builder
diff --git a/workbench/app/Livewire/Table.php b/workbench/app/Livewire/Table.php
index 5bffaed..0cda575 100644
--- a/workbench/app/Livewire/Table.php
+++ b/workbench/app/Livewire/Table.php
@@ -8,9 +8,4 @@ use Lightscale\LaralightTables\Toolbar;
abstract class Table extends TableComponent
{
- public function toolbar(): Toolbar
- {
- return new Toolbar($this);
- }
-
}