23eb9dcbda
* 384 Laravel 6 changes * Library versions * Update package versions * Add keyType to models * Remove unused dependencies * StyleCI fixes * Fix models for test * Fix tests output and update test runner * Unused imports * Update exceptions handler * Fix login page
30 lines
675 B
PHP
30 lines
675 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Console\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();
|
|
}
|
|
}
|