Add command sending
This commit is contained in:
parent
cef3e4ced4
commit
4e12c289ed
3 changed files with 104 additions and 1 deletions
30
app/Http/Requests/Api/Client/Servers/SendCommandRequest.php
Normal file
30
app/Http/Requests/Api/Client/Servers/SendCommandRequest.php
Normal 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',
|
||||
];
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue