Skip to content

Commit 3636b9a

Browse files
Merge pull request #22 from infinitybrackets/main
Main
2 parents 1a8e8b2 + 228ce3a commit 3636b9a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Core/Pagination.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ public function Paginate($total, $limit, $options = []) {
172172
}
173173
}
174174

175-
return Application::$app->ToObject($pages);
175+
// Pagination data from
176+
$start = ($page * $limit) - $limit + 1;
177+
$end = $last == $page ? ($page * $limit) - $limit + $total : $page * $limit;
178+
179+
return Application::$app->ToObject(['pages' => $pages, 'start' => $start, 'end' => $end]);
176180
}
177181
}

0 commit comments

Comments
 (0)