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

22 lines
528 B
PHP

<?php
declare(strict_types=1);
namespace Pterodactyl\Actions\Locations;
use Pterodactyl\Contracts\Locations\DeletesLocations;
use Pterodactyl\Exceptions\Service\Location\HasActiveNodesException;
use Pterodactyl\Models\Location;
final class DeleteLocation implements DeletesLocations
{
public function delete(Location $location): void
{
if ($location->nodes()->exists()) {
throw new HasActiveNodesException(trans('exceptions.locations.has_nodes'));
}
$location->delete();
}
}