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
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
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);
});
}
}