Skip to content

Commit

Permalink
readme fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ngabor84 committed May 17, 2017
1 parent 382706c commit d1011aa
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,12 @@ This is a simple request query parameter parser for REST-APIs based on Laravel's
{
use ResourceQueryParserTrait;
use BuilderParamsApplierTrait;

public function index(Request $request)
{
$params = $this->parseQueryParams($request);
$query = User::query();
$this->applyParams($query, $params);
$users = $query->get();

$this->response->collection($users, new UserTransformer, ['key' => 'users']);
}

public function indexWithPaginator(Request $request)
{
$params = $this->parseQueryParams($request);
$query = User::query();
$this->applyParams($query, $params);
$userPaginator = $query->paginate(
$params->getPagination()->getLimit(),
['*'],
'page',
$params->getPagination()->getPage()
);
$userPaginator = $this->applyParams($query, $params);

$this->response->paginator($userPaginator, new UserTransformer, ['key' => 'users']);
}
Expand Down

0 comments on commit d1011aa

Please sign in to comment.