Laravel Shopify
  • 🛍️Laravel Shopify
  • Getting Started
    • 👋Installation
  • Usage
    • Prerequisites
    • Intializing the client
    • Making Requests
      • Pagination
      • GraphQL
    • Custom Requests
    • Custom Error Handling
    • Available Methods
      • Supported Method
    • Webhooks
Powered by GitBook
On this page
  1. Usage
  2. Making Requests

Pagination

PreviousMaking RequestsNextGraphQL

Last updated 1 year ago

Shopify recently changed their pagination to , which require you grab relevant info from the "Link" header.

We've tried to simplify this by wrapping the logic in a Cursor object that implements the Iterator interface.

Example of usage:

$pages = $shopify->paginateProducts(['limit' => 100]); // returns Cursor

$results = collect();

foreach ($pages as $page) {
    // $page is a Collection of ApiResources
    $results = $results->merge($page);
}
cursor-based pagination