diff --git a/src/Illuminate/Pagination/Paginator.php b/src/Illuminate/Pagination/Paginator.php index 489b58fc2a8f..69c9ad2f1385 100644 --- a/src/Illuminate/Pagination/Paginator.php +++ b/src/Illuminate/Pagination/Paginator.php @@ -153,6 +153,7 @@ public function toArray() { return [ 'current_page' => $this->currentPage(), + 'current_page_url' => $this->url($this->currentPage()), 'data' => $this->items->toArray(), 'first_page_url' => $this->url(1), 'from' => $this->firstItem(), diff --git a/tests/Pagination/PaginatorTest.php b/tests/Pagination/PaginatorTest.php index a3d7f031a867..1881518d7ec7 100644 --- a/tests/Pagination/PaginatorTest.php +++ b/tests/Pagination/PaginatorTest.php @@ -21,6 +21,7 @@ public function testSimplePaginatorReturnsRelevantContextInformation() 'per_page' => 2, 'current_page' => 2, 'first_page_url' => '/?page=1', + 'current_page_url' => '/?page=2', 'next_page_url' => '/?page=3', 'prev_page_url' => '/?page=1', 'from' => 3,