Checks if there's a previous sibling
$file = $page->file('myfile.pdf'); if($file->hasPrev()) { echo 'Previous file: ' . $file->prev()->filename(); }