From 00707797e539b54d7949997ed497bcc46caea5a8 Mon Sep 17 00:00:00 2001 From: HolgerHatGarKeineNode Date: Sun, 18 Jan 2026 21:21:53 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20Refactor=20Livewire=20tables:=20?= =?UTF-8?q?update=20PowerGrid=20imports,=20replace=20deprecated=20methods,?= =?UTF-8?q?=20and=20enable=20`WithExport`=20trait=20for=20improved=20maint?= =?UTF-8?q?ainability.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Livewire/EinundzwanzigPlebTable.php | 21 +++++++++++---------- app/Livewire/MeetupTable.php | 14 +++++++++----- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/app/Livewire/EinundzwanzigPlebTable.php b/app/Livewire/EinundzwanzigPlebTable.php index 880e099..c94179a 100644 --- a/app/Livewire/EinundzwanzigPlebTable.php +++ b/app/Livewire/EinundzwanzigPlebTable.php @@ -7,17 +7,18 @@ use App\Models\EinundzwanzigPleb; use Illuminate\Database\Eloquent\Builder; use PowerComponents\LivewirePowerGrid\Button; use PowerComponents\LivewirePowerGrid\Column; -use PowerComponents\LivewirePowerGrid\Detail; -use PowerComponents\LivewirePowerGrid\Exportable; -use PowerComponents\LivewirePowerGrid\Footer; -use PowerComponents\LivewirePowerGrid\Header; +use PowerComponents\LivewirePowerGrid\Components\SetUp\Exportable; +use PowerComponents\LivewirePowerGrid\Facades\PowerGrid; +use PowerComponents\LivewirePowerGrid\Facades\Rule; use PowerComponents\LivewirePowerGrid\PowerGridComponent; +use PowerComponents\LivewirePowerGrid\PowerGridFields; +use PowerComponents\LivewirePowerGrid\Traits\WithExport; class EinundzwanzigPlebTable extends PowerGridComponent { - public string $sortField = 'association_status'; + use WithExport; - public string $sortDirection = 'desc'; + public string $tableName = 'einundzwanzig-pleb-table'; public string $sortField = 'association_status'; @@ -26,14 +27,14 @@ class EinundzwanzigPlebTable extends PowerGridComponent public function setUp(): array { return [ - Exportable::make('export') + PowerGrid::exportable('export') ->striped() ->type(Exportable::TYPE_XLS, Exportable::TYPE_CSV), - Header::make()->showSearchInput(), - Footer::make() + PowerGrid::header()->showSearchInput(), + PowerGrid::footer() ->showPerPage(0) ->showRecordCount(), - Detail::make() + PowerGrid::detail() ->view('components.detail') ->showCollapseIcon() ->params([]), diff --git a/app/Livewire/MeetupTable.php b/app/Livewire/MeetupTable.php index 06aef2b..d2f8c74 100644 --- a/app/Livewire/MeetupTable.php +++ b/app/Livewire/MeetupTable.php @@ -7,25 +7,29 @@ use Illuminate\Database\Eloquent\Builder; use Illuminate\Support\Carbon; use PowerComponents\LivewirePowerGrid\Button; use PowerComponents\LivewirePowerGrid\Column; -use PowerComponents\LivewirePowerGrid\Exportable; +use PowerComponents\LivewirePowerGrid\Components\SetUp\Exportable; use PowerComponents\LivewirePowerGrid\Facades\Filter; +use PowerComponents\LivewirePowerGrid\Facades\PowerGrid; use PowerComponents\LivewirePowerGrid\Facades\Rule; -use PowerComponents\LivewirePowerGrid\Footer; -use PowerComponents\LivewirePowerGrid\PowerGrid; use PowerComponents\LivewirePowerGrid\PowerGridComponent; use PowerComponents\LivewirePowerGrid\PowerGridFields; +use PowerComponents\LivewirePowerGrid\Traits\WithExport; final class MeetupTable extends PowerGridComponent { + use WithExport; + + public string $tableName = 'meetup-table'; + public function setUp(): array { $this->showCheckBox(); return [ - Exportable::make('export') + PowerGrid::exportable('export') ->striped() ->type(Exportable::TYPE_XLS, Exportable::TYPE_CSV), - Footer::make() + PowerGrid::footer() ->showPerPage(perPage: 25) ->showRecordCount(), ];