$file->delete()
Deletes the file. The store is used to manipulate the filesystem or whatever you prefer.
$file->delete(): bool
Return type
bool
Parent class
Example
if($file = $page->file('old-file.pdf')) {
try {
$file->delete();
echo 'The file has been deleted';
} catch(Exception $e) {
echo 'The file could not be deleted';
// optional reason: echo $e->getMessage();
}
}