2018-01-13 20:08:19 +00:00
|
|
|
<?php
|
|
|
|
|
2018-01-20 01:58:57 +00:00
|
|
|
namespace Pterodactyl\Http\Requests\Api\Application\Nodes;
|
2018-01-13 20:08:19 +00:00
|
|
|
|
|
|
|
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.
|
|
|
|
*
|
|
|
|
* @param array|null $rules
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function rules(array $rules = null): array
|
|
|
|
{
|
2018-02-04 21:38:38 +00:00
|
|
|
$nodeId = $this->getModel(Node::class)->id;
|
2018-01-13 20:08:19 +00:00
|
|
|
|
2019-09-05 05:26:28 +00:00
|
|
|
return parent::rules(Node::getRulesForUpdate($nodeId));
|
2018-01-13 20:08:19 +00:00
|
|
|
}
|
|
|
|
}
|