diff --git a/app/Livewire/Project/Database/BackupEdit.php b/app/Livewire/Project/Database/BackupEdit.php index 77009002c..19b7987db 100644 --- a/app/Livewire/Project/Database/BackupEdit.php +++ b/app/Livewire/Project/Database/BackupEdit.php @@ -124,10 +124,12 @@ class BackupEdit extends Component try { if ($this->delete_associated_backups_locally) { - deleteOldBackupsLocally($this->backup); + $filenames = $this->backup->executions->pluck('filename')->filter()->all(); + deleteBackupsLocally($filenames, $this->backup->server); } if ($this->delete_associated_backups_s3 && $this->backup->s3) { - deleteOldBackupsFromS3($this->backup); + $filenames = $this->backup->executions->pluck('filename')->filter()->all(); + deleteBackupsS3($filenames, $this->backup->s3); } $this->backup->delete(); diff --git a/bootstrap/helpers/databases.php b/bootstrap/helpers/databases.php index d41ae5582..fbaae637a 100644 --- a/bootstrap/helpers/databases.php +++ b/bootstrap/helpers/databases.php @@ -352,7 +352,7 @@ function deleteOldBackupsFromS3($backup): void } if (! empty($filesToDelete)) { - deleteBackupsS3($filesToDelete, $backup->server, $backup->s3); + deleteBackupsS3($filesToDelete, $backup->s3); if (! empty($executionIds)) { $backup->executions() ->whereIn('id', $executionIds)