25 lines
599 B
PHP
25 lines
599 B
PHP
<?php
|
|
|
|
namespace Pterodactyl\Http\Requests\Api\Application\Locations;
|
|
|
|
use Pterodactyl\Models\Location;
|
|
|
|
class UpdateLocationRequest extends StoreLocationRequest
|
|
{
|
|
public function resourceExists(): bool
|
|
{
|
|
$location = $this->route()->parameter('location');
|
|
|
|
return $location instanceof Location && $location->exists;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
$locationId = $this->route()->parameter('location')->id;
|
|
|
|
return collect(Location::getRulesForUpdate($locationId))->only([
|
|
'short',
|
|
'long',
|
|
])->toArray();
|
|
}
|
|
}
|