// sdk · Symfony
Symfony-Bundle für die AstroWay-API
Offizielles `astroway/sdk-symfony` auf Packagist — ein Bundle auf Basis von `astroway/sdk`. Auto-Registrierung via Symfony Flex, konfiguriert über die Standard-`config/packages/astroway.yaml`, bietet einen autowirebaren `Astroway\Astroway`-Service für die Injektion in jeden Controller oder Service. Kompatibel mit Symfony 6.4 LTS und 7.x, PHP 8.1+.
// 01 / install
Installieren
composer require astroway/sdk-symfony Import: use Astroway\Astroway;
Im Register ansehen → astroway/sdk-symfony
// 02 / highlights
Highlights
- Symfony Flex Auto-Registrierung
- Autowirebarer Astroway-Service
- Standard-Konfiguration
- Umgebungsabhängiger api-Schlüssel
- Symfony 6.4 LTS + 7.x
// 03 / first request
Erste Anfrage
<?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 mit Symfony
10.000 Credits kostenlos pro Monat. Open-Source SDK, generiert aus OpenAPI 3.1, immer synchron mit dem Backend.