Files

37 lines
865 B
PHP
Raw Permalink Normal View History

<?php
2018-11-19 22:03:03 -07:00
namespace Pterodactyl\Http\Requests\Api\Application\Locations;
use Pterodactyl\Models\Location;
use Pterodactyl\Services\Acl\Api\AdminAcl;
use Pterodactyl\Http\Requests\Api\Application\ApplicationApiRequest;
class StoreLocationRequest extends ApplicationApiRequest
{
2022-10-14 10:59:20 -06:00
protected ?string $resource = AdminAcl::RESOURCE_LOCATIONS;
2022-10-14 10:59:20 -06:00
protected int $permission = AdminAcl::WRITE;
/**
2018-05-13 10:50:56 -04:00
* Rules to validate the request against.
*/
public function rules(): array
{
return collect(Location::getRules())->only([
'long',
'short',
])->toArray();
}
/**
* Rename fields to be more clear in error messages.
*/
2022-10-14 10:59:20 -06:00
public function attributes(): array
{
return [
'long' => 'Location Description',
'short' => 'Location Identifier',
];
}
}