mirror of
https://github.com/bitinflow/expose.git
synced 2026-11-01 05:09:11 +00:00
Implement simple pagination
This commit is contained in:
1 parent
baa9819daf
commit
e960ffb825
5 files changed
+74
-7
No files matched your search
@@ -21,10 +21,10 @@ class GetUsersController extends AdminController
|
||||
public function handle(Request $request, ConnectionInterface $httpConnection)
|
||||
{
|
||||
$this->userRepository
|
||||
->getUsers()
|
||||
->then(function ($users) use ($httpConnection) {
|
||||
->paginateUsers(20, (int) $request->get('page', 1))
|
||||
->then(function ($paginated) use ($httpConnection) {
|
||||
$httpConnection->send(
|
||||
respond_json(['users' => $users])
|
||||
respond_json(['paginated' => $paginated])
|
||||
);
|
||||
|
||||
$httpConnection->close();
|
||||
|
||||
Reference in new issue
Block a user