Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Sdk Laravel Package

astroway/sdk

Official PHP SDK for the AstroWay API covering 700+ endpoints: natal charts, synastry, transits, Vedic dashas, Tarot, Numerology, Human Design and AI horoscopes. PSR-18 compatible, type-safe, with automatic retry and backoff. PHP 8.1+.

View on GitHub
Deep Wiki
Context7

Official PHP SDK for the AstroWay API — PSR-18 HTTP client (BYO Guzzle/Symfony/Nyholm), DTOs, mock client, PSR-3 logger, Guzzle promises concurrency. Natal, synastry, transits, Vedic, Tarot, Human Design, AI horoscopes. PHP 8.2+.

Frequently asked questions about Sdk
How do I install astroway/sdk in a Laravel application?
Run composer require astroway/sdk. The SDK is PSR-18 based, so you also need a PSR-18 HTTP client; if you do not already have one, install guzzlehttp/guzzle and nyholm/psr7, or let php-http/discovery pick up the client you already use. No service provider registration or publishing is required, though you will usually add a small binding in a service provider for convenience.
Does astroway/sdk support Laravel 10 and Laravel 11, and which PHP version do I need?
The package requires PHP 8.1 or newer, so it runs fine on Laravel 10 and Laravel 11 applications, which themselves need PHP 8.2+. There is nothing Laravel-version-specific in the SDK because it talks to the API through PSR interfaces rather than framework internals. Just make sure your Composer platform requirements match the SDK's PHP constraint.
Where should I store the AstroWay API key in Laravel?
Keep the key out of source control by putting ASTROWAY_API_KEY in your .env file and reading it through config('services.astroway.api_key'). Then construct the client with new Astroway(['apiKey' => config('services.astroway.api_key')]) inside a service provider or a dedicated wrapper class. This also lets you swap keys per environment or resolve them from a secrets manager in production.
How do I bind the AstroWay client in Laravel's service container?
Register a singleton in a service provider: $this->app->singleton(Astroway::class, fn () => new Astroway(['apiKey' => config('services.astroway.api_key')])). After that you can inject Astroway into controllers, jobs and services, or resolve it with app(Astroway::class). Binding it as a singleton avoids rebuilding the client and its HTTP stack on every request.
Can I use Laravel's HTTP client or Guzzle with astroway/sdk?
Yes. The SDK accepts any Psr\Http\Client\ClientInterface through the httpClient option, and you can also pass PSR-17 request and stream factories. Guzzle is auto-discovered via php-http/discovery when installed, and Symfony, Buzz or Nyholm clients work the same way. This keeps the SDK decoupled from Laravel's HTTP layer, so you configure timeouts, proxies and middleware on your own client.
How does astroway/sdk handle rate limits and API errors?
The SDK retries 408, 409, 429 and 5xx responses automatically with exponential backoff, and the retry policy is configurable. Failures surface as a typed exception hierarchy such as AuthenticationError, RateLimitError and BadRequestError, so you can catch specific cases instead of parsing status codes. In queued or scheduled work, catch RateLimitError and release the job with a delay rather than retrying in a tight loop.
How can I reduce AstroWay credit costs by caching responses in Laravel?
Endpoints cost between 5 and 500 credits per call, so cache results that do not change often, such as a natal chart for a stored birth date, using Cache::remember with a long TTL. The SDK also accepts a PSR-16 cache instance through the cache option, which you can point at Laravel's cache repository. Responses are plain arrays or DTOs you can serialize to JSON and persist if you need permanent storage.
How do I test code that uses astroway/sdk without spending credits?
Use the bundled mock client, MockAstroway, to return canned responses in unit tests so no real HTTP calls are made. In feature tests you can also bind a fake PSR-18 client into the container and assert your own wrapper behaves correctly. This keeps your Pest or PHPUnit suite fast, deterministic and free of API credit usage or rate limit flakiness.
Can I run multiple AstroWay requests concurrently or in Laravel queues?
Yes. The SDK exposes Guzzle promise-based concurrency, so you can dispatch several endpoint calls in parallel instead of waiting on each one sequentially. For heavy computations like transits or synastry batches, push the work onto Laravel queues and use the concurrent helper inside the job. Combine that with caching and monitoring of creditsRemaining in responses to keep usage predictable.
Is astroway/sdk production-ready and what are the alternatives?
The SDK is the official client, generated from an OpenAPI 3.1 spec with typed DTOs, retries, PSR-3 logging and a mock client, which makes it a reasonable production dependency for astrology features. The alternatives are calling the AstroWay REST API directly with Laravel's HTTP client, or using a different astrology provider entirely, both of which mean writing and maintaining your own request and error handling. Because the OpenAPI spec is public, you can also regenerate or replace the client if the vendor changes direction.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin