phpvms/app/Console/Commands/TestApi.php
Arthur Parienté 992b6d343a
[8.x] feature: upgrade to Laravel 13 (#2204)
* upgrade to laravel 13

* phpstan

* rollback to symfony 7.4

* fix: ModuleService merge

* refactor: new rector rules
2026-05-06 11:27:21 -05:00

31 lines
691 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 Client $httpClient;
/**
* Run dev related commands
*/
public function handle(): void
{
$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();
}
}