misc_pterodactyl-panel/app/Services/Nests/NestUpdateService.php

23 lines
444 B
PHP
Raw Normal View History

<?php
namespace Pterodactyl\Services\Nests;
2022-10-23 20:15:11 -04:00
use Pterodactyl\Models\Nest;
class NestUpdateService
{
/**
* Update a nest and prevent changing the author once it is set.
*
*/
public function handle(int $nest, array $data): void
{
2021-01-23 12:33:34 -08:00
if (!is_null(array_get($data, 'author'))) {
unset($data['author']);
}
2022-10-23 20:15:11 -04:00
$nest = Nest::query()->findOrFail($nest);
$nest->update($data);
}
}