diff options
author | Sam Light <samlight1994@gmail.com> | 2025-09-24 00:12:43 +0100 |
---|---|---|
committer | Sam Light <samlight1994@gmail.com> | 2025-09-24 00:12:43 +0100 |
commit | 94fd2a9a3cff8c926ce12046e01f481f15c02d76 (patch) | |
tree | ed9425d35a713ecee5de009fbb83b0012a0881d4 /src/TableComponent.php | |
parent | 2aca9a441ef48fb66ace8a5bfb9d8b730bc4e925 (diff) |
Changed the wrapper component to use a method
Diffstat (limited to 'src/TableComponent.php')
-rw-r--r-- | src/TableComponent.php | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/TableComponent.php b/src/TableComponent.php index 180d7c4..34d56c8 100644 --- a/src/TableComponent.php +++ b/src/TableComponent.php @@ -41,12 +41,6 @@ abstract class TableComponent extends Component protected string $tableClass = 'table'; - protected string $tableWrapperComponent = 'laralight-tables::wrapper'; - - protected string $paginationWrapperComponent = 'laralight-tables::wrapper'; - - protected string $toolbarsWrapperComponent = 'laralight-tables::wrapper'; - // Properties #[Url] public string $search = ''; @@ -247,6 +241,14 @@ abstract class TableComponent extends Component return $this->columnsCache; } + /** + * @return array{0: string, 1?: array<string,mixed>} + */ + public function wrapperComponent(string $location): array + { + return ['laralight-tables::wrapper']; + } + public function render(): View { $data = $this->buildQuery()->paginate($this->pageSize); @@ -259,9 +261,6 @@ abstract class TableComponent extends Component return view('laralight-tables::table', [ 'rootClass' => $this->rootClass, 'tableClass' => $this->tableClass, - 'tableWrapperComponent' => $this->tableWrapperComponent, - 'paginationWrapperComponent' => $this->paginationWrapperComponent, - 'toolbarsWrapperComponent' => $this->toolbarsWrapperComponent, ] + compact( 'data', 'allColumns', 'columns', 'toolbars', )); |