// sdk · Symfony
حزمة Symfony لبروتوكول AstroWay API
الرسمي `astroway/sdk-symfony` على Packagist — حزمة على رأس `astroway/sdk`. تسجيل ذاتي عبر Symfony Flex، ومُضبط عبر الملف القياسي `config/packages/astroway.yaml`، وتعرض خدمة `Astroway\Astroway` قابلة للحقن في أي متحكم أو خدمة. متوافق مع Symfony 6.4 LTS و 7.x، PHP 8.1+.
// 01 / install
التثبيت
composer require astroway/sdk-symfony استيراد: use Astroway\Astroway;
اعرض في السجل → astroway/sdk-symfony
// 02 / highlights
المميزات
- تسجيل ذاتي Symfony Flex
- خدمة Astroway قابلة للحقن
- ملف تكوين قياسي config/packages/astroway.yaml
- مفتاح api مدفوع بالبيئة
- Symfony 6.4 LTS + 7.x
// 03 / first request
أول طلب
<?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
10,000 رصيد مجاناً شهرياً. SDK مفتوح المصدر، يتم إنشاؤه من OpenAPI 3.1، ومتزامن دائماً مع الخلفية (backend).