Hi,
In LaravelController, why not use a method for parsing the limit and page parameter? Currently the parameters to retrieve these values are hardcored, like so:
$limit = $request->get('limit', $this->defaults['limit']);
$page = $request->get('page', $this->defaults['page']);
Say for example i don't want to use the 'limit' parameter to determine the number of results, but a 'per_page' parameter. Currently, to override this behaviour, a user would have to override the entire parseResourceOptions method.
I would suggest changing this into the following lines:
$limit = $this->parseLimit($request->get('limit', $this->defaults['limit']));
$page = $this->parsePage($request->get('page', $this->defaults['page']));
So in one of my controllers, i could easily override the behaviour by overriding the specific method; (example):
protected function parseLimit(?int $limit)
{
return request()->get('per_page', $limit ?: 25);
}
Also, i would suggest the validateResourceOptions
in LaravelController to be protected, since validation of pagination parameters may differ after overriding the default pagination parameters.