amrnn90 / laravel-cursor-paginator

Cursor pagination for Laravel
MIT License
19 stars 7 forks source link

onFirstPage() and hasMorePages() not working as intended #20

Open janboddez opened 3 years ago

janboddez commented 3 years ago

Since next and previous URLs are always provided, I don't think the following methods work as intended:

    public function hasMorePages()
    {
        return $this->meta['next'] != null;
    }

    public function onFirstPage()
    {
        return empty($this->meta['previous']);
    }

These might:

    public function hasMorePages()
    {
        return $this->meta['has_next'];
    }

    public function onFirstPage()
    {
        return ! $this->meta['has_previous'];
    }