2026-10-05 18:10:18 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace Pterodactyl\Http\Requests\Api\Admin\Nodes;
|
|
|
|
|
|
|
|
|
|
use Closure;
|
|
|
|
|
use Illuminate\Validation\Validator;
|
|
|
|
|
use Pterodactyl\Enum\Permissions;
|
2026-10-09 06:26:45 +01:00
|
|
|
use Pterodactyl\Models\Node;
|
2026-10-05 18:10:18 -04:00
|
|
|
|
|
|
|
|
class UpdateNodeRequest extends StoreNodeRequest
|
|
|
|
|
{
|
|
|
|
|
public function permissions(): array
|
|
|
|
|
{
|
|
|
|
|
return [Permissions::AdminNodesUpdate];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Validation rules for updating a node.
|
|
|
|
|
*
|
|
|
|
|
* @return ValidationRules
|
|
|
|
|
*/
|
2026-10-11 06:48:21 -04:00
|
|
|
public function rules(): array
|
2026-10-05 18:10:18 -04:00
|
|
|
{
|
|
|
|
|
return [
|
2026-10-11 06:48:21 -04:00
|
|
|
...parent::rules(),
|
2026-10-05 18:10:18 -04:00
|
|
|
'reset_secret' => ['sometimes', 'boolean'],
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Existing HTTP nodes can still be updated when the Panel is served over HTTPS.
|
|
|
|
|
*
|
|
|
|
|
* @return list<Closure(Validator): void>
|
|
|
|
|
*/
|
|
|
|
|
public function after(): array
|
|
|
|
|
{
|
|
|
|
|
return [];
|
|
|
|
|
}
|
2026-10-09 06:26:45 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* {@inheritdoc}
|
|
|
|
|
*/
|
|
|
|
|
protected function extensionFieldsModel(): Node
|
|
|
|
|
{
|
|
|
|
|
return $this->parameter('node', Node::class);
|
|
|
|
|
}
|
2026-10-05 18:10:18 -04:00
|
|
|
}
|