27 lines
643 B
PHP
27 lines
643 B
PHP
<?php
|
|
namespace Api\Controllers;
|
|
|
|
use Api\Core\Request;
|
|
use Api\Core\Response;
|
|
use ElixForms\ElixFormsClient;
|
|
|
|
class ExampleController
|
|
{
|
|
private ElixFormsClient $elixFormsClient;
|
|
|
|
public function __construct(ElixFormsClient $elixFormsClient)
|
|
{
|
|
$this->elixFormsClient = $elixFormsClient;
|
|
}
|
|
|
|
public function test(Request $req, Response $res)
|
|
{
|
|
$response = $this->elixFormsClient->request('GET', '/status');
|
|
|
|
return $res->json([
|
|
'external_api_response' => $response['json'] ?? $response['body'],
|
|
'status' => $response['status']
|
|
]);
|
|
}
|
|
}
|