summaryrefslogtreecommitdiff
path: root/src/Toolbar.php
diff options
context:
space:
mode:
authorSam Light <samlight1994@gmail.com>2025-09-23 22:54:57 +0100
committerSam Light <samlight1994@gmail.com>2025-09-23 22:54:57 +0100
commit2aca9a441ef48fb66ace8a5bfb9d8b730bc4e925 (patch)
treea3798b6aca1882347e7e55bb1db9249196e0ee73 /src/Toolbar.php
parent94caf14491860e35eaf07d76e1aea7ee90e1246a (diff)
Initial pint code formatting
Diffstat (limited to 'src/Toolbar.php')
-rw-r--r--src/Toolbar.php33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/Toolbar.php b/src/Toolbar.php
index 80f093b..0a8aaad 100644
--- a/src/Toolbar.php
+++ b/src/Toolbar.php
@@ -2,21 +2,21 @@
namespace Lightscale\LaralightTables;
+use Illuminate\Database\Eloquent\Model;
+use Illuminate\Support\Collection;
+use Illuminate\View\View;
+use Lightscale\LaralightTables\Concerns\Makable;
+use Lightscale\LaralightTables\Toolbar\Filter as FilterItem;
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;
-use Illuminate\Database\Eloquent\Model;
+use Lightscale\LaralightTables\Toolbar\Search as SearchItem;
class Toolbar
{
use Makable;
protected ?SearchItem $searchItem = null;
+
protected ?PageSizeItem $pageSizeItem = null;
/**
@@ -41,12 +41,12 @@ class Toolbar
/**
* @template TModel of Model
- * @param TableComponent<TModel> $table
+ *
+ * @param TableComponent<TModel> $table
*/
public function __construct(
private TableComponent $table
- )
- {
+ ) {
$this->startItems = collect();
$this->midItems = collect();
$this->endItems = collect();
@@ -59,32 +59,32 @@ class Toolbar
if ($item instanceof FilterItem) {
$this->filterItems->push($item);
- }
- else if ($item instanceof PageSizeItem) {
+ } elseif ($item instanceof PageSizeItem) {
$this->pageSizeItem = $item;
- }
- else if ($item instanceof SearchItem) {
+ } elseif ($item instanceof SearchItem) {
$this->searchItem = $item;
}
}
/**
- * @param Collection<int, ToolbarItem> $list
+ * @param Collection<int, ToolbarItem> $list
*/
private function prependItem(Collection $list, ToolbarItem $item): static
{
$this->processItem($item);
$list->prepend($item);
+
return $this;
}
/**
- * @param Collection<int, ToolbarItem> $list
+ * @param Collection<int, ToolbarItem> $list
*/
private function appendItem(Collection $list, ToolbarItem $item): static
{
$this->processItem($item);
$list->push($item);
+
return $this;
}
@@ -152,5 +152,4 @@ class Toolbar
'endItems' => $this->endItems,
]);
}
-
}