PHP code example of astroway / sdk-symfony
1. Go to this page and download the library: Download astroway/sdk-symfony library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
astroway / sdk-symfony example snippets
return [
// ...
Astroway\Symfony\AstrowayBundle::class => ['all' => true],
];
use Astroway\Astroway;
final class ChartController extends AbstractController
{
public function __construct(private readonly Astroway $astroway) {}
#[Route('/chart', methods: ['POST'])]
public function chart(Request $request): JsonResponse
{
$body = json_decode($request->getContent(), true);
$chart = $this->astroway->chart()->compute($body);
return new JsonResponse($chart);
}
}