2018-01-13 02:39:15 +00:00
|
|
|
<?php
|
|
|
|
|
2018-01-20 01:58:57 +00:00
|
|
|
namespace Pterodactyl\Http\Controllers\Api\Application\Locations;
|
2018-01-13 02:39:15 +00:00
|
|
|
|
|
|
|
use Pterodactyl\Models\Location;
|
|
|
|
use Pterodactyl\Services\Acl\Api\AdminAcl;
|
2018-01-20 03:47:06 +00:00
|
|
|
use Pterodactyl\Http\Requests\Api\Application\ApplicationApiRequest;
|
2018-01-13 02:39:15 +00:00
|
|
|
|
2018-01-20 03:47:06 +00:00
|
|
|
class StoreLocationRequest extends ApplicationApiRequest
|
2018-01-13 02:39:15 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @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.
|
2018-01-13 02:39:15 +00:00
|
|
|
*
|
|
|
|
* @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',
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|