mirror of
https://github.com/pterodactyl/panel.git
synced 2026-12-02 20:35:50 -05:00
Co-authored-by: Anthony <anthony@infraly.co> Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
20 lines
475 B
PHP
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();
|
|
}
|
|
}
|