mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-11-04 04:06:51 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			31 lines
		
	
	
		
			618 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			618 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
namespace Pterodactyl\Http\Requests\Api\Client\Servers;
 | 
						|
 | 
						|
use Pterodactyl\Models\Server;
 | 
						|
 | 
						|
class SendCommandRequest extends GetServerRequest
 | 
						|
{
 | 
						|
    /**
 | 
						|
     * Determine if the API user has permission to perform this action.
 | 
						|
     *
 | 
						|
     * @return bool
 | 
						|
     */
 | 
						|
    public function authorize(): bool
 | 
						|
    {
 | 
						|
        return $this->user()->can('control.console', $this->getModel(Server::class));
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * Rules to validate this request against.
 | 
						|
     *
 | 
						|
     * @return array
 | 
						|
     */
 | 
						|
    public function rules(): array
 | 
						|
    {
 | 
						|
        return [
 | 
						|
            'command' => 'required|string|min:1',
 | 
						|
        ];
 | 
						|
    }
 | 
						|
}
 |