misc_pterodactyl-panel/app/Http/Requests/Api/Client/Servers/SendCommandRequest.php

31 lines
606 B
PHP
Raw Normal View History

2018-02-28 04:09:34 +00:00
<?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('send-command', $this->getModel(Server::class));
}
/**
* Rules to validate this request aganist.
*
* @return array
*/
public function rules(): array
{
return [
'command' => 'string|min:1',
];
}
}