mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-19 17:34:45 +02:00
20 lines
413 B
PHP
20 lines
413 B
PHP
<?php
|
|
|
|
namespace App\Services\Servers;
|
|
|
|
use App\Enums\ServerState;
|
|
use App\Models\Server;
|
|
|
|
class ToggleInstallService
|
|
{
|
|
public function handle(Server $server): void
|
|
{
|
|
if ($server->isFailedInstall()) {
|
|
abort(500, trans('exceptions.server.marked_as_failed'));
|
|
}
|
|
|
|
$server->status = $server->isInstalled() ? ServerState::Installing : null;
|
|
$server->save();
|
|
}
|
|
}
|