From 6d26688fded015141a45a88b90b2d70a0ac88420 Mon Sep 17 00:00:00 2001 From: Sam Light Date: Sat, 26 Apr 2025 13:05:25 +0100 Subject: Larastanning --- src/Toolbar.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/Toolbar.php') diff --git a/src/Toolbar.php b/src/Toolbar.php index 10082ae..80f093b 100644 --- a/src/Toolbar.php +++ b/src/Toolbar.php @@ -10,6 +10,7 @@ use Lightscale\LaralightTables\Concerns\Makable; use Illuminate\View\View; use Illuminate\Support\Collection; +use Illuminate\Database\Eloquent\Model; class Toolbar { @@ -18,11 +19,30 @@ class Toolbar protected ?SearchItem $searchItem = null; protected ?PageSizeItem $pageSizeItem = null; + /** + * @var Collection + */ protected Collection $startItems; + + /** + * @var Collection + */ protected Collection $midItems; + + /** + * @var Collection + */ protected Collection $endItems; + + /** + * @var Collection + */ protected Collection $filterItems; + /** + * @template TModel of Model + * @param TableComponent $table + */ public function __construct( private TableComponent $table ) @@ -48,6 +68,9 @@ class Toolbar } } + /** + * @param Collection $list + */ private function prependItem(Collection $list, ToolbarItem $item): static { $this->processItem($item); @@ -55,6 +78,9 @@ class Toolbar return $this; } + /** + * @param Collection $list + */ private function appendItem(Collection $list, ToolbarItem $item): static { $this->processItem($item); @@ -92,6 +118,9 @@ class Toolbar return $this->appendItem($this->endItems, $item); } + /** + * @return TableComponent + */ public function getTable(): TableComponent { return $this->table; @@ -107,6 +136,9 @@ class Toolbar return $this->pageSizeItem; } + /** + * @return Collection + */ public function getFilters(): Collection { return $this->filterItems; -- cgit v1.2.3