Skip to content

Commit

Permalink
Add hasMorePages
Browse files Browse the repository at this point in the history
  • Loading branch information
francoism90 committed Jul 24, 2024
1 parent 45c977f commit 492bee3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Layout/Concerns/WithScroll.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ public function clear(): void
$this->resetPage();
}

public function hasMorePages(): bool
{
return $this->getPageItems()->hasMorePages();
}

protected function getPageItems(?int $page = null): LengthAwarePaginator
{
$page ??= $this->getPage();
Expand All @@ -77,6 +82,6 @@ protected function getScrollLimit(?int $page = null): int
{
$page ??= $this->getPage() ?? 1;

return Number::clamp($page, min: 1, max: 32);
return Number::clamp($page, min: 1, max: 24);
}
}

0 comments on commit 492bee3

Please sign in to comment.