Skip to content

Commit 1457fea

Browse files
committed
Remove custom pagination
1 parent 9fac690 commit 1457fea

File tree

2 files changed

+1
-50
lines changed

2 files changed

+1
-50
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
1313
### Changed
1414

1515
- Minimum Livewire version to 2.6.2 to avoid 2.6.1 bug.
16+
- Remove our custom pagination as Livewire 2.6 supports multiple pagination per page now.
1617

1718
## [1.14.0] - 2021-08-31
1819

src/Traits/WithCustomPagination.php

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Rappasoft\LaravelLivewireTables\Traits;
44

5-
use Illuminate\Pagination\Paginator;
65
use Livewire\WithPagination;
76

87
/**
@@ -24,53 +23,4 @@ public function pageName(): string
2423

2524
return 'page';
2625
}
27-
28-
/**
29-
* @return array
30-
*/
31-
public function getQueryString()
32-
{
33-
return array_merge([$this->pageName() => ['except' => 1]], $this->queryString);
34-
}
35-
36-
public function initializeWithPagination(): void
37-
{
38-
$this->{$this->pageName()} = $this->resolvePage();
39-
40-
Paginator::currentPageResolver(function () {
41-
return $this->{$this->pageName()};
42-
});
43-
44-
Paginator::defaultView($this->paginationView());
45-
}
46-
47-
public function previousPage(): void
48-
{
49-
$this->setPage($this->{$this->pageName()} - 1);
50-
}
51-
52-
public function nextPage(): void
53-
{
54-
$this->setPage($this->{$this->pageName()} + 1);
55-
}
56-
57-
public function setPage($page): void
58-
{
59-
$this->{$this->pageName()} = $page;
60-
}
61-
62-
/**
63-
* @return array|null|string
64-
*/
65-
public function resolvePage()
66-
{
67-
return request()->query($this->pageName(), $this->{$this->pageName()});
68-
}
69-
70-
public function getPublicPropertiesDefinedBySubClass()
71-
{
72-
return tap(parent::getPublicPropertiesDefinedBySubClass(), function (&$props) {
73-
$props[$this->pageName()] = $this->{$this->pageName()};
74-
});
75-
}
7626
}

0 commit comments

Comments
 (0)