PteroTheme/app/Services/Locations/LocationUpdateService.php

25 lines
471 B
PHP
Raw Normal View History

<?php
namespace Pterodactyl\Services\Locations;
use Pterodactyl\Models\Location;
class LocationUpdateService
{
/**
* Update an existing location.
*
*/
public function handle(Location|int $location, array $data): Location
{
2022-10-24 05:37:21 +01:00
/** @var Location $location */
if (is_int($location)) {
$location = Location::query()->findOrFail($location);
}
2022-10-24 05:37:21 +01:00
$location->update($data);
return $location;
}
}