From 7af77c9357fd0ffe330e933e1405afc941d5d92c Mon Sep 17 00:00:00 2001 From: Constantin Graf Date: Mon, 27 May 2024 15:17:37 +0200 Subject: [PATCH] Fixed storage env --- app/Service/Import/ImportService.php | 3 ++- config/jetstream.php | 2 +- config/logging.php | 5 +++++ tests/Unit/Service/Import/ImportServiceTest.php | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/Service/Import/ImportService.php b/app/Service/Import/ImportService.php index eff8f98d..225e46d5 100644 --- a/app/Service/Import/ImportService.php +++ b/app/Service/Import/ImportService.php @@ -24,7 +24,8 @@ class ImportService /** @var ImporterContract $importer */ $importer = app(ImporterProvider::class)->getImporter($importerType); $importer->init($organization); - Storage::disk('s3')->put('import/'.Carbon::now()->toDateString().'-'.$organization->getKey().'-'.Str::uuid(), $data); + Storage::disk(config('filesystems.default')) + ->put('import/'.Carbon::now()->toDateString().'-'.$organization->getKey().'-'.Str::uuid(), $data); DB::transaction(function () use (&$importer, &$data) { $importer->importData($data); diff --git a/config/jetstream.php b/config/jetstream.php index 11bd6f76..755a1e67 100644 --- a/config/jetstream.php +++ b/config/jetstream.php @@ -77,6 +77,6 @@ return [ | */ - 'profile_photo_disk' => env('PROFILE_PHOTO_DISK', 's3'), + 'profile_photo_disk' => env('PROFILE_PHOTO_DISK', env('PUBLIC_FILESYSTEM_DISK', 'public')), ]; diff --git a/config/logging.php b/config/logging.php index bdb21c84..9a6d62c3 100644 --- a/config/logging.php +++ b/config/logging.php @@ -67,6 +67,11 @@ return [ 'replace_placeholders' => true, ], + 'stderr_daily' => [ + 'driver' => 'stack', + 'channels' => ['stderr', 'daily'], + ], + 'stack_production' => [ 'driver' => 'stack', 'channels' => ['stderr', 'sentry'], diff --git a/tests/Unit/Service/Import/ImportServiceTest.php b/tests/Unit/Service/Import/ImportServiceTest.php index 0e34ba23..3bd6c4cb 100644 --- a/tests/Unit/Service/Import/ImportServiceTest.php +++ b/tests/Unit/Service/Import/ImportServiceTest.php @@ -17,7 +17,7 @@ class ImportServiceTest extends TestCase public function test_import_gets_importer_from_provider_runs_importer_and_returns_report(): void { // Arrange - Storage::fake('s3'); + Storage::fake(config('filesystems.default')); $organization = Organization::factory()->create(); $data = file_get_contents(storage_path('tests/toggl_time_entries_import_test_1.csv'));