Skip to content

Commit

Permalink
Merge pull request #22 from takielias/dev
Browse files Browse the repository at this point in the history
Fix Pagination limit change
  • Loading branch information
takielias authored Jun 4, 2024
2 parents 74a3b7a + 17cbe13 commit 7e7eee8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/DataTable/DataTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,9 @@ protected function paginate($limit): void
$this->limit = $limit;
}


protected function getPaginate(): Paginator
protected function getPaginate($limit): Paginator
{
return $this->dataSource->paginate($this->limit);
return $this->dataSource->paginate($limit);
}

/**
Expand All @@ -196,11 +195,11 @@ protected function getPaginate(): Paginator
*/
public function getData(Request $request)
{
$limit = $request->limit ?? 10;
$limit = $request->limit ?? $this->limit;
$paginator = $this
->search($request)
->sort($request)
->getPaginate();
->getPaginate($limit);

return [
'data' => $this->format($paginator->items()),
Expand Down

0 comments on commit 7e7eee8

Please sign in to comment.