Files

50 lines
995 B
PHP
Raw Permalink Normal View History

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;
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 [];
}
/**
* {@inheritdoc}
*/
protected function extensionFieldsModel(): Node
{
return $this->parameter('node', Node::class);
}
2026-10-05 18:10:18 -04:00
}