// sdk · Symfony
AstroWay API'si için Symfony Bundle
Resmi `astroway/sdk-symfony` Packagist'te — `astroway/sdk` üzerine kurulu bir Bundle. Symfony Flex aracılığıyla otomatik olarak kaydeder, standard `config/packages/astroway.yaml` aracılığıyla yapılandırılır, herhangi bir kontrolcüye veya hizmete enjeksiyon için autowireable bir `Astroway\Astroway` hizmeti sunar. Symfony 6.4 LTS ve 7.x, PHP 8.1+ ile uyumlu.
// 01 / install
Kur
composer require astroway/sdk-symfony import: use Astroway\Astroway;
Kayıtta görüntüle → astroway/sdk-symfony
// 02 / highlights
Öne çıkanlar
- Symfony Flex otomatik kayıt
- Autowireable Astroway hizmeti
- Standart config/packages/astroway.yaml yapılandırması
- Çevre tarafından yönlendirilen api_anahtarı
- Symfony 6.4 LTS + 7.x
// 03 / first request
İlk istek
<?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);
}
} Symfony ile başla
Ayda 10.000 kredi ücretsiz. Open-source SDK, OpenAPI 3.1’den oluşturulur, her zaman arka uçla senkron.