Files
pterodactyl-panel/app/Actions/Allocations/SetPrimaryAllocation.php
T

20 lines
475 B
PHP
Raw Normal View History

2026-10-05 18:10:18 -04:00
<?php
declare(strict_types=1);
namespace Pterodactyl\Actions\Allocations;
use Pterodactyl\Contracts\Allocations\SetsPrimaryAllocations;
use Pterodactyl\Models\Allocation;
use Pterodactyl\Models\Server;
final class SetPrimaryAllocation implements SetsPrimaryAllocations
{
public function setPrimary(Server $server, Allocation $allocation): Allocation
{
$server->update(['allocation_id' => $allocation->id]);
return $allocation->refresh();
}
}