2017-06-15 05:53:24 +01:00
|
|
|
<?php
|
|
|
|
|
2017-09-15 06:16:03 +01:00
|
|
|
namespace Pterodactyl\Services\Locations;
|
2017-06-15 05:53:24 +01:00
|
|
|
|
2017-09-15 06:16:03 +01:00
|
|
|
use Pterodactyl\Models\Location;
|
2017-06-15 05:53:24 +01:00
|
|
|
|
2017-09-15 06:16:03 +01:00
|
|
|
class LocationUpdateService
|
2017-06-15 05:53:24 +01:00
|
|
|
{
|
|
|
|
/**
|
2017-09-15 06:16:03 +01:00
|
|
|
* Update an existing location.
|
2017-06-15 05:53:24 +01:00
|
|
|
*
|
|
|
|
*/
|
2022-10-14 17:59:20 +01:00
|
|
|
public function handle(Location|int $location, array $data): Location
|
2017-06-15 05:53:24 +01:00
|
|
|
{
|
2017-09-15 06:16:03 +01:00
|
|
|
$location = ($location instanceof Location) ? $location->id : $location;
|
2017-06-15 05:53:24 +01:00
|
|
|
|
2022-10-23 09:25:49 +01:00
|
|
|
return $location->update($data);
|
2017-06-15 05:53:24 +01:00
|
|
|
}
|
|
|
|
}
|