AstroWay/api v2.74.0 · fr
tous les systèmes sont opérationnels
// sdk · Symfony

Bundle Symfony pour l'API AstroWay

Officiel `astroway/sdk-symfony` sur Packagist — un bundle basé sur `astroway/sdk`. Enregistrement automatique via Symfony Flex, configuré via le standard `config/packages/astroway.yaml`, expose un service `Astroway\Astroway` autowirable pour injection dans n'importe quel contrôleur ou service. Compatibile avec Symfony 6.4 LTS et 7.x, PHP 8.1+.

// 01 / install

Installer

composer require astroway/sdk-symfony

importation: use Astroway\Astroway;

// 02 / highlights

Fonctionnalités

// 03 / first request

Première requête

<?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);
    }
}

Démarrer avec Symfony

10 000 crédits gratuits par mois. SDK open-source, généré à partir d'OpenAPI 3.1, toujours synchronisé avec le backend.

99,9% SLA · forfaits payants · 30 j statut →