AstroWay/api v2.74.0 · it
tutti i sistemi sono operativi
// sdk · Symfony

Bundle Symfony per l'API AstroWay

Ufficiale `astroway/sdk-symfony` su Packagist — un Bundle basato su `astroway/sdk`. Si registra automaticamente tramite Symfony Flex, configurato tramite il file `config/packages/astroway.yaml` standard, espone un servizio `Astroway\Astroway` autowireable per l'iniezione in qualsiasi controller o servizio. Compatibile con Symfony 6.4 LTS e 7.x, PHP 8.1+.

// 01 / install

Installa

composer require astroway/sdk-symfony

importa: use Astroway\Astroway;

// 02 / highlights

Funzionalità

// 03 / first request

Prima richiesta

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

Inizia con Symfony

10.000 crediti gratis al mese. SDK open-source, generato da OpenAPI 3.1, sempre sincronizzato con il backend.

99.9% SLA · piani a pagamento · 30d stato →