diff --git a/src/Picqer/Financials/Moneybird/Actions/Filterable.php b/src/Picqer/Financials/Moneybird/Actions/Filterable.php index 4d99be2..3b9f62d 100644 --- a/src/Picqer/Financials/Moneybird/Actions/Filterable.php +++ b/src/Picqer/Financials/Moneybird/Actions/Filterable.php @@ -11,18 +11,24 @@ trait Filterable /** * @param array $filters + * @param int|null $perPage Number of results per page + * @param int|null $page Page to load, typically starts at 1 * @return mixed * * @throws \Picqer\Financials\Moneybird\Exceptions\ApiException */ - public function filter(array $filters) + public function filter(array $filters, $perPage = null, $page = null) { $filterList = []; foreach ($filters as $key => $value) { $filterList[] = $key . ':' . $value; } - $result = $this->connection()->get($this->getFilterEndpoint(), ['filter' => implode(',', $filterList)]); + $result = $this->connection()->get($this->getFilterEndpoint(), [ + 'filter' => implode(',', $filterList), + 'per_page' => $perPage, + 'page' => $page, + ], false); return $this->collectionFromResult($result); }