Path: blob/1.0-develop/app/Services/Locations/LocationUpdateService.php
10277 views
<?php12namespace Pterodactyl\Services\Locations;34use Pterodactyl\Models\Location;5use Pterodactyl\Contracts\Repository\LocationRepositoryInterface;67class LocationUpdateService8{9/**10* LocationUpdateService constructor.11*/12public function __construct(protected LocationRepositoryInterface $repository)13{14}1516/**17* Update an existing location.18*19* @throws \Pterodactyl\Exceptions\Model\DataValidationException20* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException21*/22public function handle(Location|int $location, array $data): Location23{24$location = ($location instanceof Location) ? $location->id : $location;2526return $this->repository->update($location, $data);27}28}293031