File tree Expand file tree Collapse file tree 1 file changed +2
-18
lines changed
Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Original file line number Diff line number Diff line change @@ -33,28 +33,12 @@ This is a simple request query parameter parser for REST-APIs based on Laravel's
3333 {
3434 use ResourceQueryParserTrait;
3535 use BuilderParamsApplierTrait;
36-
36+
3737 public function index(Request $request)
3838 {
3939 $params = $this->parseQueryParams($request);
4040 $query = User::query();
41- $this->applyParams($query, $params);
42- $users = $query->get();
43-
44- $this->response->collection($users, new UserTransformer, ['key' => 'users']);
45- }
46-
47- public function indexWithPaginator(Request $request)
48- {
49- $params = $this->parseQueryParams($request);
50- $query = User::query();
51- $this->applyParams($query, $params);
52- $userPaginator = $query->paginate(
53- $params->getPagination()->getLimit(),
54- ['*'],
55- 'page',
56- $params->getPagination()->getPage()
57- );
41+ $userPaginator = $this->applyParams($query, $params);
5842
5943 $this->response->paginator($userPaginator, new UserTransformer, ['key' => 'users']);
6044 }
You can’t perform that action at this time.
0 commit comments