Update Location with Application API

Update the given location.

Usage

<?php
    $pterodactyl->updateLocation($locationId, array $data);

    //For a location instance
    $location->update(array $data);
?>

Parameters

Parameter Description Rules
locationId The id of the location
data The data to update location

data

Parameter Description Rules
short Short name required|string|between:1,60|unique:locations,short
long Long name required|string|between:1,255

Returns

Returns a location instance.

{
    "id": 3,
    "short": "location-4",
    "long": "location-4",
    "createdAt": "2019-12-16T05:20:19+00:00",
    "updatedAt": "2019-12-16T05:23:16+00:00",
    "object": "location"
}

Example

<?php
    $location = $pterodactyl->updateLocation(3, [
        'short' => 'location-4',
        'long' => 'location-4'
    ]);
    print_r($location);
?>
<?php
    try {
        $location = $pterodactyl->location(3);
        $location->update([
            'short' => 'location-4',
            'long' => 'location-4'
        ]);
    } catch(\Exception $e){
        print_r($e->getMessage());
    }
?>