Path: blob/1.0-develop/app/Services/Servers/ReinstallServerService.php
10276 views
<?php12namespace Pterodactyl\Services\Servers;34use Pterodactyl\Models\Server;5use Illuminate\Database\ConnectionInterface;6use Pterodactyl\Repositories\Wings\DaemonServerRepository;78class ReinstallServerService9{10/**11* ReinstallService constructor.12*/13public function __construct(14private ConnectionInterface $connection,15private DaemonServerRepository $daemonServerRepository,16) {17}1819/**20* Reinstall a server on the remote daemon.21*22* @throws \Throwable23*/24public function handle(Server $server): Server25{26return $this->connection->transaction(function () use ($server) {27$server->fill(['status' => Server::STATUS_INSTALLING])->save();2829$this->daemonServerRepository->setServer($server)->reinstall();3031return $server->refresh();32});33}34}353637