From cf8041cfe7544889c7d4c28e5b1e27cd1671bbd0 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Mon, 3 May 2021 10:32:11 +0200 Subject: [PATCH] fix: fix importvcard job (#5151) --- app/Http/Controllers/SettingsController.php | 2 +- app/Models/Account/ImportJob.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index 2c2b32a5a..2ddbd9558 100644 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -240,7 +240,7 @@ class SettingsController throw new AccountLimitException(); } - $filename = $request->file('vcard')->store('imports', 'public'); + $filename = $request->file('vcard')->store('imports', config('filesystems.default')); $importJob = $account->importjobs()->create([ 'user_id' => auth()->user()->id, diff --git a/app/Models/Account/ImportJob.php b/app/Models/Account/ImportJob.php index 729bb95de..d408653de 100644 --- a/app/Models/Account/ImportJob.php +++ b/app/Models/Account/ImportJob.php @@ -161,7 +161,7 @@ class ImportJob extends Model private function getPhysicalFile() { try { - $this->physicalFile = Storage::disk('public')->readStream($this->filename); + $this->physicalFile = Storage::disk(config('filesystems.default'))->readStream($this->filename); } catch (FileNotFoundException $exception) { $this->fail(trans('settings.import_vcard_file_not_found')); } @@ -176,7 +176,7 @@ class ImportJob extends Model */ private function deletePhysicalFile(): void { - if (! Storage::disk('public')->delete($this->filename)) { + if (! Storage::disk(config('filesystems.default'))->delete($this->filename)) { $this->fail(trans('settings.import_vcard_file_not_found')); } }