mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 14:23:44 +02:00
api(application): fix requests, again
This commit is contained in:
@@ -11,19 +11,9 @@ use Pterodactyl\Http\Requests\Api\Application\ApplicationApiRequest;
|
||||
|
||||
class StoreServerRequest extends ApplicationApiRequest
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $resource = AdminAcl::RESOURCE_SERVERS;
|
||||
protected string $resource = AdminAcl::RESOURCE_SERVERS;
|
||||
protected int $permission = AdminAcl::WRITE;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $permission = AdminAcl::WRITE;
|
||||
|
||||
/**
|
||||
* Rules to be applied to this request.
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
$rules = Server::getRules();
|
||||
@@ -71,12 +61,7 @@ class StoreServerRequest extends ApplicationApiRequest
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize the data into a format that can be consumed by the service.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function validated()
|
||||
public function validated(): array
|
||||
{
|
||||
$data = parent::validated();
|
||||
|
||||
@@ -105,11 +90,6 @@ class StoreServerRequest extends ApplicationApiRequest
|
||||
];
|
||||
}
|
||||
|
||||
/*
|
||||
* Run validation after the rules above have been applied.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Validation\Validator $validator
|
||||
*/
|
||||
public function withValidator(Validator $validator)
|
||||
{
|
||||
$validator->sometimes('allocation.default', [
|
||||
@@ -139,12 +119,7 @@ class StoreServerRequest extends ApplicationApiRequest
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a deployment object that can be passed to the server creation service.
|
||||
*
|
||||
* @return \Pterodactyl\Models\Objects\DeploymentObject|null
|
||||
*/
|
||||
public function getDeploymentObject()
|
||||
public function getDeploymentObject(): ?DeploymentObject
|
||||
{
|
||||
if (is_null($this->input('deploy'))) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user