Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

i74ifa's avatar

lumen cursorPaginate error when OrderBy is 0

I have a problem with cursorPaginate

When I arrange the data using orderBy, the pages arrive until the number is zero for example

Any::OrderByDesc('views')->cursorPaginate();

The Sql Code

	
SELECT *
FROM `any`
ORDER BY `views` DESC
LIMIT 6

Page 2 (load more)

SELECT *
FROM `any`
WHERE  (`views` < 45)
ORDER BY `views` DESC
LIMIT 6

Page 3 (load more)

	
SELECT *
FROM `any`
WHERE  (`views` < 0)
ORDER BY `views` DESC
LIMIT 6

In this case it is impossible for views to be less than 0

Only arrays and objects are supported when cursor paginating items.

0 likes
0 replies

Please or to participate in this conversation.