Files
2026-10-12 05:18:58 -04:00

22 lines
570 B
PHP

<?php
declare(strict_types=1);
namespace Pterodactyl\Actions\Allocations;
use Pterodactyl\Contracts\Allocations\DeletesAllocations;
use Pterodactyl\Exceptions\Service\Allocation\ServerUsingAllocationException;
use Pterodactyl\Models\Allocation;
final class DeleteAllocation implements DeletesAllocations
{
public function delete(Allocation $allocation): void
{
if ($allocation->server_id !== null) {
throw new ServerUsingAllocationException(trans('exceptions.allocations.server_using'));
}
$allocation->delete();
}
}