src/Support/PaginatedCollection.php
public function jsonSerialize()
    {
        $json = parent::jsonSerialize();

        $json['totalCount'] = $this->getTotalCount();
        $json['currentPage'] = $this->getCurrentPage();
        $json['pageSize'] = $this->getPageSize();
        $json['totalNrPages'] = $this->getTotalNrPages();
        $json['nextPage'] = $this->getNextPage();
        $json['previousPage'] = $this->getPreviousPage();

        return $json;
    }
public function jsonSerialize()
    {
        $json = parent::jsonSerialize();

        $json['totalCount'] = $this->getTotalCount();
        $json['currentPage'] = $this->getCurrentPage();
        $json['pageSize'] = $this->getPageSize();
        $json['totalNrPages'] = $this->getTotalNrPages();
        $json['nextPage'] = $this->getNextPage();
        $json['previousPage'] = $this->getPreviousPage();

        return $json;
    }
Specify data which should be serialized to JSON