Files
pterodactyl-panel/app/Actions/Allocations/SetPrimaryAllocation.php
T
6c0413e39b Start 2.0 development
Co-authored-by: Anthony <anthony@infraly.co>
Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
2026-10-05 18:10:18 -04:00

20 lines
475 B
PHP

<?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();
}
}