From 25deb8200a26583e509409b9a154331994c21116 Mon Sep 17 00:00:00 2001 From: Cesar Perez Date: Tue, 3 Sep 2024 06:33:12 -0600 Subject: [PATCH] Table: additional condition to display `perPage` selector (#601) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix table pagination X scroll * Additional condition to display perPage selector Hide perPage selection on empty tables --------- Co-authored-by: Robson TenĂ³rio --- src/View/Components/Pagination.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/View/Components/Pagination.php b/src/View/Components/Pagination.php index 84f08d94..27b76e07 100644 --- a/src/View/Components/Pagination.php +++ b/src/View/Components/Pagination.php @@ -26,7 +26,7 @@ public function modelName(): ?string public function isShowable(): bool { - return ! empty($this->modelName()) && $this->rows instanceof LengthAwarePaginator; + return ! empty($this->modelName()) && $this->rows instanceof LengthAwarePaginator && $this->rows->isNotEmpty(); } public function render(): View|Closure|string