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')); } }