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
Aftership Php Sdk

Aftership Php Sdk Laravel Package

aftership/aftership-php-sdk

Official PHP SDK for the AfterShip tracking API. Manage shipments, couriers, and tracking statuses through a clean, framework-friendly client, with Laravel integration for configuration, service providers, and dependency injection.

View on GitHub
Deep Wiki
Context7

The PHP SDK of AfterShip API

Frequently asked questions about Aftership Php Sdk
How do I install aftership/aftership-php-sdk in a Laravel project?
Run composer require aftership/aftership-php-sdk, then resolve the client from Laravel's container instead of instantiating it inside controllers. The usual pattern is a small service provider that builds the client from an API key in config/services.php and binds it behind your own interface. Budget roughly half a day for a greenfield spike covering install, authentication, and one tracking call against the AfterShip 2024-01 sandbox.
Does aftership/aftership-php-sdk ship a Laravel service provider or facade?
No. The SDK is a framework-agnostic REST client with no service provider, no publishable config file, and no facade, so any Laravel integration is code you write yourself. Register a singleton in a service provider that wires the API key and HTTP client, and inject your own gateway interface into the classes that need shipment data.
Which AfterShip API version does version 6.0.0 support?
The 6.0.0 release note states support for API 2024-01. Whether it also supports older versions in parallel is not documented in the release, so check the source or client options before assuming multi-version support. If your AfterShip account is still provisioned on an older API version, confirm migration timing with AfterShip before building against 6.0.0.
Is aftership/aftership-php-sdk actively maintained?
A single 6.0.0 release after a long gap is evidence of activity, not evidence of a maintenance cadence. It does not tell you whether a 7.0.0 will arrive when API 2024-01 is deprecated, or whether security issues will be patched. Check commit history, who merged the release, and issue response times before treating the package as supported upstream.
What breaking changes are there between 5.x and 6.0.0?
The release note is one line with no changelog, so the only reliable answer is a diff between the 5.x and 6.0.0 tags. Expect renamed or removed endpoints, changed request and response payload shapes, and possibly a raised PHP floor and a tighter Guzzle constraint. If you are already integrated on 5.x, budget a full upgrade spike, because your fakes and contract tests will need to move with the dependency.
How do I test AfterShip tracking calls in a Laravel app?
The SDK has no Http::fake() story; it talks to the API through Guzzle, so you either mock at the Guzzle handler level or, better, hide it behind your own gateway interface and fake that. Faking your own interface keeps tests readable and avoids rewrites every time the SDK or the API contract shifts. Keep a small set of contract tests against the real sandbox to catch payload drift.
How should I store the AfterShip API key in Laravel?
Keep the key out of source control and out of constructor defaults: put it in .env, expose it through config/services.php, and let Laravel's encrypted config or your secret manager hold the real value. Resolve the client from the container so the key is read once at boot. Rotating the key should never require a code change.
Does the SDK verify AfterShip webhook signatures or handle idempotency?
No. Webhook signature verification, replay protection, and idempotent status updates are all your responsibility; the SDK only wraps outbound API calls. Verify the signature with the webhook secret before touching your database, and store a dedupe key per event so retried deliveries do not double-apply status transitions.
Can I use this SDK with Laravel 10 or 11, and which PHP version does it need?
The client is not Laravel-specific, so it runs wherever its Guzzle dependency runs, but 6.0.0 likely raised the minimum PHP version. Read the php and guzzlehttp/guzzle constraints in composer.json before planning the upgrade, and run a throwaway install to confirm the resolver picks a compatible set. There are no other dependents on the package, so you will be the first to exercise it on a modern Laravel stack.
Should I call the AfterShip SDK directly or wrap it in my own interface?
Wrap it. Put a TrackingGateway interface in your domain and an AfterShipGateway implementation around the SDK, and keep both out of controllers and Eloquent models. The interface is what survives if the SDK goes dormant or you fork it, which matters for a package with a single major release and no dependents. Treat the SDK as a consumable dependency with a maintained fork as your contingency, not as code you own.
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.
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle