mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2026-01-27 06:33:18 +00:00
🚀 Refactor Livewire tables: update PowerGrid imports, replace deprecated methods, and enable WithExport trait for improved maintainability.
This commit is contained in:
@@ -7,17 +7,18 @@ use App\Models\EinundzwanzigPleb;
|
|||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use PowerComponents\LivewirePowerGrid\Button;
|
use PowerComponents\LivewirePowerGrid\Button;
|
||||||
use PowerComponents\LivewirePowerGrid\Column;
|
use PowerComponents\LivewirePowerGrid\Column;
|
||||||
use PowerComponents\LivewirePowerGrid\Detail;
|
use PowerComponents\LivewirePowerGrid\Components\SetUp\Exportable;
|
||||||
use PowerComponents\LivewirePowerGrid\Exportable;
|
use PowerComponents\LivewirePowerGrid\Facades\PowerGrid;
|
||||||
use PowerComponents\LivewirePowerGrid\Footer;
|
use PowerComponents\LivewirePowerGrid\Facades\Rule;
|
||||||
use PowerComponents\LivewirePowerGrid\Header;
|
|
||||||
use PowerComponents\LivewirePowerGrid\PowerGridComponent;
|
use PowerComponents\LivewirePowerGrid\PowerGridComponent;
|
||||||
|
use PowerComponents\LivewirePowerGrid\PowerGridFields;
|
||||||
|
use PowerComponents\LivewirePowerGrid\Traits\WithExport;
|
||||||
|
|
||||||
class EinundzwanzigPlebTable extends PowerGridComponent
|
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';
|
public string $sortField = 'association_status';
|
||||||
|
|
||||||
@@ -26,14 +27,14 @@ class EinundzwanzigPlebTable extends PowerGridComponent
|
|||||||
public function setUp(): array
|
public function setUp(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
Exportable::make('export')
|
PowerGrid::exportable('export')
|
||||||
->striped()
|
->striped()
|
||||||
->type(Exportable::TYPE_XLS, Exportable::TYPE_CSV),
|
->type(Exportable::TYPE_XLS, Exportable::TYPE_CSV),
|
||||||
Header::make()->showSearchInput(),
|
PowerGrid::header()->showSearchInput(),
|
||||||
Footer::make()
|
PowerGrid::footer()
|
||||||
->showPerPage(0)
|
->showPerPage(0)
|
||||||
->showRecordCount(),
|
->showRecordCount(),
|
||||||
Detail::make()
|
PowerGrid::detail()
|
||||||
->view('components.detail')
|
->view('components.detail')
|
||||||
->showCollapseIcon()
|
->showCollapseIcon()
|
||||||
->params([]),
|
->params([]),
|
||||||
|
|||||||
@@ -7,25 +7,29 @@ use Illuminate\Database\Eloquent\Builder;
|
|||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
use PowerComponents\LivewirePowerGrid\Button;
|
use PowerComponents\LivewirePowerGrid\Button;
|
||||||
use PowerComponents\LivewirePowerGrid\Column;
|
use PowerComponents\LivewirePowerGrid\Column;
|
||||||
use PowerComponents\LivewirePowerGrid\Exportable;
|
use PowerComponents\LivewirePowerGrid\Components\SetUp\Exportable;
|
||||||
use PowerComponents\LivewirePowerGrid\Facades\Filter;
|
use PowerComponents\LivewirePowerGrid\Facades\Filter;
|
||||||
|
use PowerComponents\LivewirePowerGrid\Facades\PowerGrid;
|
||||||
use PowerComponents\LivewirePowerGrid\Facades\Rule;
|
use PowerComponents\LivewirePowerGrid\Facades\Rule;
|
||||||
use PowerComponents\LivewirePowerGrid\Footer;
|
|
||||||
use PowerComponents\LivewirePowerGrid\PowerGrid;
|
|
||||||
use PowerComponents\LivewirePowerGrid\PowerGridComponent;
|
use PowerComponents\LivewirePowerGrid\PowerGridComponent;
|
||||||
use PowerComponents\LivewirePowerGrid\PowerGridFields;
|
use PowerComponents\LivewirePowerGrid\PowerGridFields;
|
||||||
|
use PowerComponents\LivewirePowerGrid\Traits\WithExport;
|
||||||
|
|
||||||
final class MeetupTable extends PowerGridComponent
|
final class MeetupTable extends PowerGridComponent
|
||||||
{
|
{
|
||||||
|
use WithExport;
|
||||||
|
|
||||||
|
public string $tableName = 'meetup-table';
|
||||||
|
|
||||||
public function setUp(): array
|
public function setUp(): array
|
||||||
{
|
{
|
||||||
$this->showCheckBox();
|
$this->showCheckBox();
|
||||||
|
|
||||||
return [
|
return [
|
||||||
Exportable::make('export')
|
PowerGrid::exportable('export')
|
||||||
->striped()
|
->striped()
|
||||||
->type(Exportable::TYPE_XLS, Exportable::TYPE_CSV),
|
->type(Exportable::TYPE_XLS, Exportable::TYPE_CSV),
|
||||||
Footer::make()
|
PowerGrid::footer()
|
||||||
->showPerPage(perPage: 25)
|
->showPerPage(perPage: 25)
|
||||||
->showRecordCount(),
|
->showRecordCount(),
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user