misc_pterodactyl-panel/app/Http/Requests/Api/Application/Locations/StoreLocationRequest.php

47 lines
975 B
PHP
Raw Normal View History

<?php
2018-11-20 05:03:03 +00: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
{
/**
* @var string
*/
protected $resource = AdminAcl::RESOURCE_LOCATIONS;
/**
* @var int
*/
protected $permission = AdminAcl::WRITE;
/**
2018-05-13 14:50:56 +00:00
* Rules to validate the request against.
*
* @return array
*/
public function rules(): array
{
return collect(Location::getCreateRules())->only([
'long',
'short',
])->toArray();
}
/**
* Rename fields to be more clear in error messages.
*
* @return array
*/
public function attributes()
{
return [
'long' => 'Location Description',
'short' => 'Location Identifier',
];
}
}