mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-10-31 10:16:52 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			23 lines
		
	
	
		
			563 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			563 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.
 | |
|      *
 | |
|      * @param array|null $rules
 | |
|      * @return array
 | |
|      */
 | |
|     public function rules(array $rules = null): array
 | |
|     {
 | |
|         $nodeId = $this->getModel(Node::class)->id;
 | |
| 
 | |
|         return parent::rules(Node::getUpdateRulesForId($nodeId));
 | |
|     }
 | |
| }
 | 
