summaryrefslogtreecommitdiff
path: root/workbench/app
diff options
context:
space:
mode:
authorSam Light <samlight1994@gmail.com>2025-09-24 00:13:09 +0100
committerSam Light <samlight1994@gmail.com>2025-09-24 00:13:09 +0100
commit2a349e8a4222b76724ed21626f332e9f3237318f (patch)
tree1be23fa35819fa275f2fd156f1062ca62d55c611 /workbench/app
parent94fd2a9a3cff8c926ce12046e01f481f15c02d76 (diff)
Demo usage of the wrapperComponentHEADv1.3.0master
Diffstat (limited to 'workbench/app')
-rw-r--r--workbench/app/Livewire/ProductsTable.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/workbench/app/Livewire/ProductsTable.php b/workbench/app/Livewire/ProductsTable.php
index 6a52cc5..c3e29a5 100644
--- a/workbench/app/Livewire/ProductsTable.php
+++ b/workbench/app/Livewire/ProductsTable.php
@@ -19,6 +19,8 @@ class ProductsTable extends Table
{
protected $model = Product::class;
+ protected string $tableClass = 'table mb-0';
+
public function toolbars(): array
{
$categoryFilter = SelectFilter::make('category')
@@ -67,4 +69,13 @@ class ProductsTable extends Table
->sortable(fn (Builder $q, string $dir) => $q->orderBy('stock', $dir)),
];
}
+
+ public function wrapperComponent(string $location): array
+ {
+ return match ($location) {
+ 'table' => ['table.card-table', ['title' => 'Products']],
+ 'pagination' => ['table.card-pagination'],
+ default => parent::wrapperComponent($location),
+ };
+ }
}