Every index endpoint returns paginated data. This data can be mutated by using Eager Loading or Partial Data. Check out the documentation on how to use those to get only the needed fields.Paginate#
An index request always returns the following structure:With limit
, total
and offset
you can create your own pagination system. If for example you want to show the amount of pages, you can use Math.ceil(total / limit)
. To go to a specific page; use limit * (page - 1)
. This will calculate the offset
for the specified page. Page one would return zero; page two would return limit.Offset pagination can result in data not being fetched or being fetched twice.
For example: Someone is adding a resource which should be showing up in page 1, but you are already fetching page 2. Page 1 just became bigger by one, so page 2 will see the last item of page 1 at the top of the list again. Modified at 2025-05-13 05:24:45