public function fileDestroy(Storage $storage, $instanceId, $id)
{
if (empty($id) || !($file = File::find($id))) {
throw new InvalidArgumentException();
}
if ($file->userId !== Auth::id()) {
throw new AccessDeniedHttpException();
}
try {
$result = $storage->remove($file);
} catch (\Exception $e) {
$result = false;
}
return XePresenter::makeApi(['deleted' => $result]);
}