From ef5d0fb4a2a2d11899e070018d04518c573e74a5 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 21 Dec 2019 23:26:15 -0800 Subject: [PATCH] Add deletion code to the panel --- app/Repositories/Wings/DaemonServerRepository.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/Repositories/Wings/DaemonServerRepository.php b/app/Repositories/Wings/DaemonServerRepository.php index 676eed6d7..ae4d1333a 100644 --- a/app/Repositories/Wings/DaemonServerRepository.php +++ b/app/Repositories/Wings/DaemonServerRepository.php @@ -72,11 +72,19 @@ class DaemonServerRepository extends DaemonRepository } /** - * Delete a server from the daemon. + * Delete a server from the daemon, forcibly if passed. + * + * @throws \Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException */ public function delete(): void { - throw new BadMethodCallException('Method is not implemented.'); + Assert::isInstanceOf($this->server, Server::class); + + try { + $this->getHttpClient()->delete('/api/servers/' . $this->server->uuid); + } catch (TransferException $exception) { + throw new DaemonConnectionException($exception); + } } /**