mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-13 10:15:40 +00:00
refactor(backups): centralize storage deletion guard
This commit is contained in:
1 parent
4e03be755d
commit
bf72fd5d88
6 files changed
+38
-21
No files matched your search
@@ -56,6 +56,13 @@ class LocalPersistentVolume extends BaseModel
|
||||
return $this->morphMany(ScheduledVolumeBackup::class, 'backupable');
|
||||
}
|
||||
|
||||
public function abortIfScheduledBackupsExist(): void
|
||||
{
|
||||
if ($this->scheduledBackups()->exists()) {
|
||||
abort(422, 'Delete this volume backup schedule and its archives before deleting the volume.');
|
||||
}
|
||||
}
|
||||
|
||||
protected function customizeName($value)
|
||||
{
|
||||
return str($value)->trim()->value;
|
||||
|
||||
Reference in new issue
Block a user