// sdk · Symfony
Symfony Bundle voor de AstroWay API
Officiële `astroway/sdk-symfony` op Packagist — een Bundle bovenop `astroway/sdk`. Auto-registreert via Symfony Flex, geconfigureerd via het standaard `config/packages/astroway.yaml`, biedt een autowireable `Astroway\Astroway` service voor injectie in elke controller of service. Compatibel met Symfony 6.4 LTS en 7.x, PHP 8.1+.
// 01 / install
Installeren
composer require astroway/sdk-symfony importeren: use Astroway\Astroway;
Bekijk in de registry → astroway/sdk-symfony
// 02 / highlights
Kenmerken
- Symfony Flex auto-registreert
- Autowireable Astroway service
- Standaard config/packages/astroway.yaml
- omgevingsvariabele api_sleutel
- Symfony 6.4 LTS + 7.x
// 03 / first request
Eerste verzoek
<?php
// config/packages/astroway.yaml
// astroway:
// api_key: '%env(ASTROWAY_API_KEY)%'
use Astroway\Astroway;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Attribute\Route;
final class ChartController extends AbstractController
{
public function __construct(private readonly Astroway $astroway) {}
#[Route('/chart')]
public function chart(): JsonResponse
{
$chart = $this->astroway->post('/chart', body: [
'date' => '1990-07-14',
'time' => '14:30:00',
'timezoneOffset' => 3,
'latitude' => 50.4501,
'longitude' => 30.5234,
'houseSystem' => 'P',
]);
return $this->json($chart);
}
} Start met Symfony
10.000 credits gratis per maand. Open-source SDK, gegenereerd vanuit OpenAPI 3.1, altijd synchroon met de backend.