I am using mongodb as a database (jenssegers/mongodb). I created a method to get users sorted by their account creation. There are more than 10 users, the first 10 are retrieved with the correct sorting, but when I get the next page, I get empty data, as if there are no more users.
public function getUsers() {
return User::orderBy('created_at', 'desc')->cursorPaginate(10);
}
Specifically this comment: As you can see, you cannot rely on the ?page=2 query param used for offset pagination. You must use the provided next_page_url param to get the next page of results.
@Nakov Just the same, I use the link that comes to me along with the data (https://site.com/getUsers?cursor=....). With a new request already on this link, I get empty data, as I wrote in my post