$file->next()

Returns the next sibling

  • return ($file)

Example

if($next = $page->file('myfile.pdf')->next()) {
  echo 'Next file: ' . $next->filename();
}