Path: blob/1.0-develop/app/Services/Nests/NestUpdateService.php
10262 views
<?php12namespace Pterodactyl\Services\Nests;34use Pterodactyl\Contracts\Repository\NestRepositoryInterface;56class NestUpdateService7{8/**9* NestUpdateService constructor.10*/11public function __construct(protected NestRepositoryInterface $repository)12{13}1415/**16* Update a nest and prevent changing the author once it is set.17*18* @throws \Pterodactyl\Exceptions\Model\DataValidationException19* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException20*/21public function handle(int $nest, array $data): void22{23if (!is_null(array_get($data, 'author'))) {24unset($data['author']);25}2627$this->repository->withoutFreshModel()->update($nest, $data);28}29}303132