misc_pterodactyl-panel/app/Repositories/Daemon/CommandRepository.php

26 lines
683 B
PHP
Raw Normal View History

<?php
namespace Pterodactyl\Repositories\Daemon;
use Psr\Http\Message\ResponseInterface;
use Pterodactyl\Contracts\Repository\Daemon\CommandRepositoryInterface;
class CommandRepository extends BaseRepository implements CommandRepositoryInterface
{
/**
* Send a command to a server.
*
* @param string $command
* @return \Psr\Http\Message\ResponseInterface
2018-05-13 16:19:35 +00:00
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function send(string $command): ResponseInterface
{
2017-10-01 02:00:24 +00:00
return $this->getHttpClient()->request('POST', 'server/command', [
'json' => [
'command' => $command,
],
]);
}
}