summaryrefslogtreecommitdiff
path: root/src/Toolbar.php
diff options
context:
space:
mode:
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;