summaryrefslogtreecommitdiff
path: root/src/Toolbar.php
diff options
context:
space:
mode:
authorSam Light <samlight1994@gmail.com>2025-04-26 13:05:25 +0100
committerSam Light <samlight1994@gmail.com>2025-04-26 13:05:25 +0100
commit6d26688fded015141a45a88b90b2d70a0ac88420 (patch)
tree33324531f6e9595c7eb190b89bcdb5a7b55d1b5f /src/Toolbar.php
parent88f71aeba1a1649661d713297d3a75454636b2d1 (diff)
Larastanning
Diffstat (limited to 'src/Toolbar.php')
-rw-r--r--src/Toolbar.php32
1 files changed, 32 insertions, 0 deletions
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<int, ToolbarItem>
+ */
protected Collection $startItems;
+
+ /**
+ * @var Collection<int, ToolbarItem>
+ */
protected Collection $midItems;
+
+ /**
+ * @var Collection<int, ToolbarItem>
+ */
protected Collection $endItems;
+
+ /**
+ * @var Collection<int, FilterItem>
+ */
protected Collection $filterItems;
+ /**
+ * @template TModel of Model
+ * @param TableComponent<TModel> $table
+ */
public function __construct(
private TableComponent $table
)
@@ -48,6 +68,9 @@ class Toolbar
}
}
+ /**
+ * @param Collection<int, ToolbarItem> $list
+ */
private function prependItem(Collection $list, ToolbarItem $item): static
{
$this->processItem($item);
@@ -55,6 +78,9 @@ class Toolbar
return $this;
}
+ /**
+ * @param Collection<int, ToolbarItem> $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<Model>
+ */
public function getTable(): TableComponent
{
return $this->table;
@@ -107,6 +136,9 @@ class Toolbar
return $this->pageSizeItem;
}
+ /**
+ * @return Collection<int, FilterItem>
+ */
public function getFilters(): Collection
{
return $this->filterItems;