AstroWay/api v2.74.0 · hu
minden rendszer működik rendben
// sdk · Symfony

Symfony csomag az AstroWay API-hoz

Hivatalos `astroway/sdk-symfony` a Packagist-en — egy csomag az `astroway/sdk` tetején. Auto-regisztrálja magát a Symfony Flex segítségével, konfigurálható a standard `config/packages/astroway.yaml` fájlban, biztosít egy autowireable `Astroway\Astroway` szolgáltatást bármely vezérlő vagy szolgáltatásba történő injekcióhoz. Kompatibilis a Symfony 6.4 LTS és 7.x, PHP 8.1+.

// 01 / install

Telepítés

composer require astroway/sdk-symfony

import: use Astroway\Astroway;

// 02 / highlights

Főbb jellemzők

// 03 / first request

Első kérés

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

Indulás Symfony-vel

10 000 credit ingyenesen havonta. Nyílt forráskódú SDK, generálva az OpenAPI 3.1-ből, mindig szinkronban a backenddel.

99,9% SLA · fizetős csomagok · 30 nap állapot →