From e744b8d67ef1d18050158dd523ba7d804c1c8528 Mon Sep 17 00:00:00 2001 From: Sam Light Date: Sun, 30 Mar 2025 14:20:57 +0100 Subject: Filters, sorting, escaping and more.... --- src/Toolbar.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/Toolbar.php') diff --git a/src/Toolbar.php b/src/Toolbar.php index 2db39f5..8539e0e 100644 --- a/src/Toolbar.php +++ b/src/Toolbar.php @@ -5,7 +5,7 @@ namespace Lightscale\LaralightTables; use Lightscale\LaralightTables\Toolbar\Item as ToolbarItem; use Lightscale\LaralightTables\Toolbar\Search as SearchItem; use Lightscale\LaralightTables\Toolbar\PageSize as PageSizeItem; -use Lightscale\LaralightTables\Toolbar\Filter as FitlerItem; +use Lightscale\LaralightTables\Toolbar\Filter as FilterItem; use Illuminate\View\View; use Illuminate\Support\Collection; @@ -18,6 +18,7 @@ class Toolbar protected Collection $startItems; protected Collection $midItems; protected Collection $endItems; + protected Collection $filterItems; public function __construct( private TableComponent $table @@ -26,6 +27,7 @@ class Toolbar $this->startItems = collect(); $this->midItems = collect(); $this->endItems = collect(); + $this->filterItems = collect(); } private function addItem(Collection $list, ToolbarItem $item): static @@ -76,6 +78,11 @@ class Toolbar return $this->pageSizeItem; } + public function getFilters(): Collection + { + return $this->filterItems; + } + public function render(): View { return view('laralight-tables::toolbar', [ -- cgit v1.2.3