Pagination on the list, optional auth
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace Api\Users;
|
||||
|
||||
use Khofmann\Api\Api;
|
||||
use Khofmann\Input\Input;
|
||||
use Khofmann\Models\User\User;
|
||||
use Khofmann\Response\Response;
|
||||
|
||||
@@ -10,6 +11,8 @@ class Users extends Api
|
||||
{
|
||||
public function get()
|
||||
{
|
||||
Response::json(User::list());
|
||||
$page = max(0, intval(Input::get("p", 0)));
|
||||
$limit = constrain(0, 30, intval(Input::get("l", 10)));
|
||||
Response::json(User::list($page, $limit));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user