Skip to content

Commit d1011aa

Browse files
committed
readme fix
1 parent 382706c commit d1011aa

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

README.md

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)