2018-01-13 02:39:15 +00:00
|
|
|
<?php
|
|
|
|
|
2018-01-20 01:58:57 +00:00
|
|
|
namespace Pterodactyl\Http\Requests\Api\Application\Locations;
|
2018-01-13 02:39:15 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2019-09-05 05:26:28 +00:00
|
|
|
return collect(Location::getRulesForUpdate($locationId))->only([
|
2018-01-13 02:39:15 +00:00
|
|
|
'short',
|
|
|
|
'long',
|
2019-03-02 21:27:36 +00:00
|
|
|
])->toArray();
|
2018-01-13 02:39:15 +00:00
|
|
|
}
|
|
|
|
}
|