summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Light <samlight1994@gmail.com>2025-04-02 22:29:34 +0100
committerSam Light <samlight1994@gmail.com>2025-04-02 22:29:34 +0100
commit350dc0827e0ff9e4f47c2df23187a35e8a8cf58b (patch)
treeabc6d1c1f6f6ba697059fa026dc83cf2bbb047f0
parente73b21ab36a00f012baf3076e9bd0fc1ab84036c (diff)
Remamed functions more
-rw-r--r--src/Toolbar.php15
-rw-r--r--workbench/app/Livewire/ProductsTable.php8
2 files changed, 13 insertions, 10 deletions
diff --git a/src/Toolbar.php b/src/Toolbar.php
index 27d495d..10082ae 100644
--- a/src/Toolbar.php
+++ b/src/Toolbar.php
@@ -6,12 +6,15 @@ 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 FilterItem;
+use Lightscale\LaralightTables\Concerns\Makable;
use Illuminate\View\View;
use Illuminate\Support\Collection;
class Toolbar
{
+ use Makable;
+
protected ?SearchItem $searchItem = null;
protected ?PageSizeItem $pageSizeItem = null;
@@ -59,32 +62,32 @@ class Toolbar
return $this;
}
- public function prependStartItem(ToolbarItem $item): static
+ public function prependStart(ToolbarItem $item): static
{
return $this->prependItem($this->startItems, $item);
}
- public function appendStartItem(ToolbarItem $item): static
+ public function appendStart(ToolbarItem $item): static
{
return $this->appendItem($this->startItems, $item);
}
- public function prependMidItem(ToolbarItem $item): static
+ public function prependMid(ToolbarItem $item): static
{
return $this->prependItem($this->midItems, $item);
}
- public function appendMidItem(ToolbarItem $item): static
+ public function appendMid(ToolbarItem $item): static
{
return $this->appendItem($this->midItems, $item);
}
- public function prependEndItem(ToolbarItem $item): static
+ public function prependEnd(ToolbarItem $item): static
{
return $this->prependItem($this->endItems, $item);
}
- public function appendEndItem(ToolbarItem $item): static
+ public function appendEnd(ToolbarItem $item): static
{
return $this->appendItem($this->endItems, $item);
}
diff --git a/workbench/app/Livewire/ProductsTable.php b/workbench/app/Livewire/ProductsTable.php
index a9e128b..1ae33be 100644
--- a/workbench/app/Livewire/ProductsTable.php
+++ b/workbench/app/Livewire/ProductsTable.php
@@ -31,10 +31,10 @@ class ProductsTable extends Table
);
return parent::toolbar()
- ->appendStartItem(Search::make())
- ->appendStartItem($categoryFilter)
- ->appendEndItem(PageSize::make())
- ->appendEndItem(ColumnSelect::make());
+ ->appendStart(Search::make())
+ ->appendStart($categoryFilter)
+ ->appendEnd(PageSize::make())
+ ->appendEnd(ColumnSelect::make());
}
public function query(): Builder