Add command sending

This commit is contained in:
Dane Everitt 2018-02-27 22:09:34 -06:00
parent cef3e4ced4
commit 4e12c289ed
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 104 additions and 1 deletions

View file

@ -0,0 +1,30 @@
<?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',
];
}
}