From 40607777a5752523f6750312675db09665726a5f Mon Sep 17 00:00:00 2001 From: Sam Light Date: Wed, 2 Apr 2025 23:18:08 +0100 Subject: Switch to allow multiple toolbars --- workbench/app/Livewire/ProductsTable.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'workbench/app/Livewire/ProductsTable.php') 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 -- cgit v1.2.3