Add R2 options to filesystems

This commit is contained in:
David Bomba 2022-10-22 17:04:42 +11:00
parent 89c42a257c
commit 76badf854c
4 changed files with 19 additions and 0 deletions

View File

@ -218,6 +218,8 @@ class CreateEntityPdf implements ShouldQueue
// } // }
Storage::disk($this->disk)->put($file_path, $pdf, 'public'); Storage::disk($this->disk)->put($file_path, $pdf, 'public');
//r2 Storage::disk($this->disk)->put($file_path, $pdf);
} catch (\Exception $e) { } catch (\Exception $e) {
throw new FilePermissionsFailure($e->getMessage()); throw new FilePermissionsFailure($e->getMessage());
} }

View File

@ -105,6 +105,8 @@ class CreatePurchaseOrderPdf implements ShouldQueue
Storage::disk($this->disk)->put($this->file_path, $pdf, 'public'); Storage::disk($this->disk)->put($this->file_path, $pdf, 'public');
//r2 Storage::disk($this->disk)->put($this->file_path, $pdf);
} }
catch(\Exception $e) catch(\Exception $e)
{ {

View File

@ -111,6 +111,8 @@ class GenerateDeliveryNote
Storage::disk($this->disk)->put($file_path, $pdf, 'public'); Storage::disk($this->disk)->put($file_path, $pdf, 'public');
//r2 Storage::disk($this->disk)->put($file_path, $pdf);
return $file_path; return $file_path;
} }
} }

View File

@ -79,6 +79,19 @@ return [
'throw' => false, 'throw' => false,
], ],
'r2' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'visibility' => 'private',
'endpoint' => env('AWS_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'throw' => false,
],
'gcs' => [ 'gcs' => [
'driver' => 'gcs', 'driver' => 'gcs',
'project_id' => env('GOOGLE_CLOUD_PROJECT_ID', 'your-project-id'), 'project_id' => env('GOOGLE_CLOUD_PROJECT_ID', 'your-project-id'),