Fix server deletion

This commit is contained in:
Dane Everitt 2017-04-21 17:21:00 -04:00
parent 8dc24471ae
commit e0958414d7
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53

View file

@ -761,9 +761,7 @@ class ServerRepository
$server->load('subusers.permissions');
$server->subusers->each(function ($subuser) {
$subuser->permissions->each(function ($permission) {
$perm->delete();
});
$subuser->permissions->each->delete();
$subuser->delete();
});
@ -774,7 +772,7 @@ class ServerRepository
// This is the one un-recoverable point where
// transactions will not save us.
$repository = new DatabaseRepository;
$server->databases->each(function ($item) {
$server->databases->each(function ($item) use ($repository) {
$repository->drop($item->id);
});