Skip to content

Commit

Permalink
Merge pull request #6 from greezen/feat-method
Browse files Browse the repository at this point in the history
feat: add page method
  • Loading branch information
BinaryAlan authored Oct 29, 2024
2 parents af6c322 + 0f30c44 commit 6bb04cf
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/Paginator.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,38 @@ public function toJson(int $options = 0): string
return json_encode($this->jsonSerialize(), $options);
}

/**
* Get the items being paginated.
*/
public function items(): Collection
{
return $this->items;
}

/**
* get current page.
*/
public function currentPage(): int
{
return $this->currentPage;
}

/**
* get per page size.
*/
public function perPage(): int
{
return $this->perPage;
}

/**
* get total items.
*/
public function total(): int
{
return $this->totalItems;
}

/**
* Set the items for the paginator.
* @param mixed $items
Expand Down

0 comments on commit 6bb04cf

Please sign in to comment.