From 27ddeeacb51f5d2e9691c1eee68ca2132684b35e Mon Sep 17 00:00:00 2001 From: Mathias Palmqvist Date: Mon, 30 Jun 2025 11:11:29 +0200 Subject: [PATCH] Make page and pagesize optional --- src/Resources/Customer.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/Resources/Customer.php b/src/Resources/Customer.php index 186451f..9827828 100644 --- a/src/Resources/Customer.php +++ b/src/Resources/Customer.php @@ -13,12 +13,19 @@ class Customer /** * Get a list of all customers. */ - public function all(int $page = 1, int $pageSize = 25): object + public function all(?int $page = null, ?int $pageSize = null): object { - return $this->client->get('customers', [ - 'page' => $page, - 'pageSize' => $pageSize, - ]); + $query = []; + + if ($page !== null) { + $query['page'] = $page; + } + + if ($pageSize !== null) { + $query['pageSize'] = $pageSize; + } + + return $this->client->get('customers', $query); } public function get(string $customerId): object