Add support for deleting service packs.

This commit is contained in:
Dane Everitt
2016-11-18 17:31:57 -05:00
parent d4729427aa
commit 5600f3201c
3 changed files with 39 additions and 14 deletions

View File

@@ -225,4 +225,13 @@ class Pack
});
}
public function delete($id) {
$pack = Models\ServicePack::findOrFail($id);
// @TODO Check for linked servers; foreign key should block this.
DB::transaction(function () use ($pack) {
$pack->delete();
Storage::deleteDirectory('packs/' . $pack->uuid);
});
}
}