Skip to content

Commit ec76574

Browse files
authored
Add current_page_url to Paginator (#55789)
1 parent a9bfc0d commit ec76574

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/Illuminate/Pagination/Paginator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ public function toArray()
153153
{
154154
return [
155155
'current_page' => $this->currentPage(),
156+
'current_page_url' => $this->url($this->currentPage()),
156157
'data' => $this->items->toArray(),
157158
'first_page_url' => $this->url(1),
158159
'from' => $this->firstItem(),

tests/Pagination/PaginatorTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public function testSimplePaginatorReturnsRelevantContextInformation()
2121
'per_page' => 2,
2222
'current_page' => 2,
2323
'first_page_url' => '/?page=1',
24+
'current_page_url' => '/?page=2',
2425
'next_page_url' => '/?page=3',
2526
'prev_page_url' => '/?page=1',
2627
'from' => 3,

0 commit comments

Comments
 (0)