s3 bandwidth usage fix

This commit is contained in:
Čarodej
2022-03-29 10:06:20 +02:00
parent 8c59501907
commit 9d4d1ba9aa
28 changed files with 205 additions and 214 deletions

View File

@@ -38,12 +38,12 @@ class ZipAction
// Add file into zip
if (Storage::exists($filePath)) {
// local disk
if (is_storage_driver('local')) {
if (isStorageDriver('local')) {
$zip->add(Storage::path($filePath), $file->name);
}
// s3 client
if (is_storage_driver('s3')) {
if (isStorageDriver('s3')) {
$bucketName = config('filesystems.disks.s3.bucket');
$zip->add("s3://$bucketName/$filePath", $file->name);
@@ -75,12 +75,12 @@ class ZipAction
$zipDestination = "{$file['folder_path']}/{$file['name']}";
// local disk
if (is_storage_driver('local')) {
if (isStorageDriver('local')) {
$zip->add(Storage::path($filePath), $zipDestination);
}
// s3 client
if (is_storage_driver('s3')) {
if (isStorageDriver('s3')) {
$bucketName = config('filesystems.disks.s3.bucket');
$zip->add("s3://$bucketName/$filePath", $zipDestination);