For pagination apiato uses the L5 Repository Package and the
pagination gets applied whenever you use the
paginate function on any model repository
$stores = $this->storeRepository->paginate();).
?page= parameter can be applied to any
GET HTTP request responsible for listing records (mainly for Paginated data).
Pagination object is always returned in meta when pagination is available on the endpoint.
?limit= parameter can be applied to define, how many results should be returned on one page (also see Pagination).
This would return 100 resources within one page of the result. Of course, the
page query parameter can be
combined in order to get the next 100 resources:
In order to allow clients to request all data that matches their criteria (e.g., search-criteria) and disable pagination,
you can manually override the
$allowDisablePagination property in your specific
Repository class. A requester can then
get all data (with no pagination applied) by requesting
api.domain.test/endpoint?limit=0. This will return all matching
.env file and set a number for
This is used in the
config/repository.php which is the config file of the L5 Repository Package.
In order to allow clients to request all data that matches their criteria (e.g. search-criteria) and disable pagination,
you can set
A request can then get all data (with no pagination applied) by applying
This will return all matching entities: