fix local references in upload/export disk. first step for #1727.

This commit is contained in:
HamuZ HamuZ
2018-10-13 09:56:26 +03:00
parent cf11dfe73b
commit f696353e2c
9 changed files with 36 additions and 44 deletions

View File

@@ -34,7 +34,7 @@ use FireflyIII\User;
use Illuminate\Contracts\Filesystem\FileNotFoundException;
use Illuminate\Support\Collection;
use Log;
use Storage;
use Illuminate\Support\Facades\Storage;
/**
* Class AttachmentRepository.
@@ -66,9 +66,9 @@ class AttachmentRepository implements AttachmentRepositoryInterface
/** @var AttachmentHelperInterface $helper */
$helper = app(AttachmentHelperInterface::class);
$file = $helper->getAttachmentLocation($attachment);
$path = $helper->getAttachmentLocation($attachment);
try {
unlink($file);
Storage::disk('upload')->delete($path);
} catch (Exception $e) {
Log::error(sprintf('Could not delete file for attachment %d: %s', $attachment->id, $e->getMessage()));
}