feat: admin view for deleting users
This commit is contained in:
@@ -26,6 +26,34 @@ class Team extends Model implements SendsDiscord, SendsEmail
|
||||
throw new \Exception('You are not allowed to update this team.');
|
||||
}
|
||||
});
|
||||
|
||||
static::deleting(function ($team) {
|
||||
$keys = $team->privateKeys;
|
||||
foreach ($keys as $key) {
|
||||
ray('Deleting key: ' . $key->name);
|
||||
$key->delete();
|
||||
}
|
||||
$sources = $team->sources();
|
||||
foreach ($sources as $source) {
|
||||
ray('Deleting source: ' . $source->name);
|
||||
$source->delete();
|
||||
}
|
||||
$tags = Tag::whereTeamId($team->id)->get();
|
||||
foreach ($tags as $tag) {
|
||||
ray('Deleting tag: ' . $tag->name);
|
||||
$tag->delete();
|
||||
}
|
||||
$shared_variables = $team->environment_variables();
|
||||
foreach ($shared_variables as $shared_variable) {
|
||||
ray('Deleting team shared variable: ' . $shared_variable->name);
|
||||
$shared_variable->delete();
|
||||
}
|
||||
$s3s = $team->s3s;
|
||||
foreach ($s3s as $s3) {
|
||||
ray('Deleting s3: ' . $s3->name);
|
||||
$s3->delete();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function routeNotificationForDiscord()
|
||||
|
||||
Reference in New Issue
Block a user