Weave Code
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
Stuart Client Php

Stuart Client Php Laravel Package

stuartapp/stuart-client-php

Official PHP client for the Stuart delivery API. Authenticate to sandbox or production, create/validate/get/cancel jobs and deliveries, fetch pricing and ETA, and make custom requests. Includes a Docker demo and Composer install.

View on GitHub
Deep Wiki
Context7

Stuart PHP client

Frequently asked questions about Stuart Client Php
Is this package still maintained since it’s archived? What should I do if Stuart’s API changes?
The package hasn’t been updated since 2021, so it may not support Stuart’s latest API changes. Check Stuart’s official documentation for an updated SDK or contact their support for guidance. If you proceed, implement retry logic and error handling to mitigate API breaking changes.
How do I install and configure the Stuart PHP client in Laravel?
Run `composer require stuartapp/stuart-client-php` to install. Store your API key in `.env` (e.g., `STUART_API_KEY=your_key`) and initialize the client in a Laravel service. Example: `$client = new StuartClient(['apiKey' => env('STUART_API_KEY')]);`.
Does this package work with Laravel 9 or PHP 8.1+?
Yes, the package supports PHP 7.4+, making it compatible with Laravel 8+. For PHP 8.1+, test thoroughly as some features (like named arguments) may not be fully utilized. No Laravel-specific optimizations exist, so manual dependency injection is required.
Can I use this for real-time tracking updates? Does it support webhooks?
No, this client does not support Stuart’s webhooks. You’ll need to implement polling or manual checks to fetch updates. For high-frequency tracking, consider caching responses or using Laravel Queues to avoid rate limits.
How do I handle errors or failed API requests in production?
The package likely throws exceptions for HTTP errors (e.g., 4xx/5xx). Wrap API calls in try-catch blocks and log failures using Laravel’s `Log` facade. Implement retry logic for transient errors, but avoid infinite loops by capping attempts.
Is there a way to mock the Stuart API for testing in Laravel?
Yes, use tools like VCR or Pest’s HTTP mocking to record and replay API responses. For PHPUnit, mock the `StuartClient` class directly or use a testing library like Mockery to simulate API calls without hitting Stuart’s servers.
What are the API rate limits for Stuart’s delivery API?
Stuart’s rate limits aren’t documented in the package, so check their [official API docs](https://developer.stuart.com) for specifics (e.g., requests per minute). Monitor your app’s usage and implement caching or batching to avoid throttling, especially in high-volume scenarios.
Does this package support async operations or Laravel Queues?
The client is stateless, so you can dispatch API calls as Laravel Queues jobs. However, the package itself doesn’t include async or queue-specific features. Ensure your job handles retries and timeouts gracefully.
Are there alternatives to this package if Stuart deprecates it?
If Stuart stops supporting this package, consider their official SDK (if available) or alternatives like [ShipEngine](https://www.shipengine.com/) or [SendCloud](https://www.sendcloud.com/) with their own PHP clients. Evaluate migration effort based on API compatibility and feature parity.
How do I integrate this with Laravel’s Facade pattern for cleaner code?
The package doesn’t include a Facade, but you can create one. Publish a Facade class (e.g., `Stuart::createShipment()`) in `app/Facades/Stuart.php` and bind the `StuartClient` in a service provider. This improves readability but adds a thin abstraction layer.
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.
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor
spatie/laravel-javascript-views