$files->first()
Returns the first element
$files->first(): File|null
Return types
Kirby\Cms\Fileornull
Parent class
Kirby\Cms\Files
inherited from Kirby\Toolkit\Collection
Examples
if ($file = $page->files()->first()) {
echo $file->filename();
} ?>