Skip to content

Commit ef5d0fb

Browse files
committed
Add deletion code to the panel
1 parent 04d67ea commit ef5d0fb

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

app/Repositories/Wings/DaemonServerRepository.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,19 @@ public function update(array $data): void
7272
}
7373

7474
/**
75-
* Delete a server from the daemon.
75+
* Delete a server from the daemon, forcibly if passed.
76+
*
77+
* @throws \Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException
7678
*/
7779
public function delete(): void
7880
{
79-
throw new BadMethodCallException('Method is not implemented.');
81+
Assert::isInstanceOf($this->server, Server::class);
82+
83+
try {
84+
$this->getHttpClient()->delete('/api/servers/' . $this->server->uuid);
85+
} catch (TransferException $exception) {
86+
throw new DaemonConnectionException($exception);
87+
}
8088
}
8189

8290
/**

0 commit comments

Comments
 (0)