Reference

$page->hasNext()

Checks if there's a next item in the collection

$page->hasNext(): bool

Return type

bool

Example

<?php
echo $page->hasNext(); //will echo 1 if true, nothing if false.
?>

Using sort field

<?php
echo $page->hasNext('date', 'desc'); //will echo 1 if true, nothing if false.
?>

Source code

kirby/src/Cms/HasSiblings.php#L89