misc_pterodactyl-panel/app/Http/Requests/Api/Application/Nodes/UpdateNodeRequest.php
2021-01-23 12:33:34 -08:00

19 lines
501 B
PHP

<?php
namespace Pterodactyl\Http\Requests\Api\Application\Nodes;
use Pterodactyl\Models\Node;
class UpdateNodeRequest extends StoreNodeRequest
{
/**
* Apply validation rules to this request. Uses the parent class rules()
* function but passes in the rules for updating rather than creating.
*/
public function rules(array $rules = null): array
{
$nodeId = $this->getModel(Node::class)->id;
return parent::rules(Node::getRulesForUpdate($nodeId));
}
}