Reference

$page->hasPrev()

Checks if there's a previous item in the collection

$page->hasPrev(): bool

Return type

bool

Example

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

Using sort field

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

Source code

kirby/src/Cms/HasSiblings.php#L99