Skip to main content

Overview

All list() methods return a Page<T> object. Every page includes the data array, metadata about the total result set, and links to the next/previous page.

The Page Object


Manual Pagination

Control pagination yourself with $page and $perPage:

Auto-Pagination with iter()

Every resource exposes an iter() method that automatically fetches all pages and yields individual items:
Internally, iter() calls list() repeatedly, following links->next until there are no more pages.
Use iter() whenever you need all items. It handles pagination transparently and uses PHP generators, so it doesn’t load the full result set into memory at once.

Collecting into an Array

If you need a full array, use iterator_to_array():

Pagination Parameters

ParameterTypeDefaultDescription
$pageint|null1Page number (1-indexed)
$perPageint|null20Items per page (max 100)