mirror of
https://github.com/tiennm99/coolify.git
synced 2026-09-05 02:19:20 +00:00
refactor(backups): centralize storage deletion guard
This commit is contained in:
@@ -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