phpvms/app/Console/Commands/TestApi.php
Nabeel S aedb1f22b6
Don't allow cancels from certain states (#396)
* Don't allow cancels from certain states

* Unused imports

* Don't reset the state doubly

* Move SetUserActive into listener; code cleanup

* Unused imports

* Add missing files into htaccess

* Move Command contract to correct folder
2019-09-16 13:08:26 -04:00

30 lines
677 B
PHP

<?php
namespace App\Console\Commands;
use App\Contracts\Command;
use GuzzleHttp\Client;
class TestApi extends Command
{
protected $signature = 'phpvms:test-api {apikey} {url}';
protected $httpClient;
/**
* Run dev related commands
*/
public function handle()
{
$this->httpClient = new Client([
'headers' => [
'Authorization' => $this->argument('apikey'),
'Content-type' => 'application/json',
'X-API-Key' => $this->argument('apikey'),
],
]);
$result = $this->httpClient->get($this->argument('url'));
echo $result->getBody();
}
}