Files
panel/app/Services/Servers/ToggleInstallService.php
Lance Pioch 4ff5adc2a6 Monthly Shift: July 2026 (#2433)
Co-authored-by: Shift <shift@laravelshift.com>
2026-07-09 09:55:11 -04:00

18 lines
388 B
PHP

<?php
namespace App\Services\Servers;
use App\Enums\ServerState;
use App\Models\Server;
class ToggleInstallService
{
public function handle(Server $server): void
{
abort_if($server->isFailedInstall(), 500, trans('exceptions.server.marked_as_failed'));
$server->status = $server->isInstalled() ? ServerState::Installing : null;
$server->save();
}
}