wheesnoza/laravel-ship24
Composer 安装命令:
composer require wheesnoza/laravel-ship24
包简介
A Ship24 API Rapper for Laravel.
README 文档
README
Laravel Ship24 is a powerful package that integrates the Ship24 API seamlessly into your Laravel application. With this package, you can easily track shipments, create new trackers, and manage your tracking information.
Table of Contents
- Features
- Compatibility
- Support Policy
- Verification Status
- Known Limitations
- Breaking Changes
- Installation
- Configuration
- Usage
- Rate Limit Handling
- Testing
- Contributing
- License
Features
Easy Installation
Install via Composer and publish the configuration file to get started quickly.
Tracking API Integration
Provides simplified access to Ship24 tracking endpoints for creating trackers and retrieving results.
Extensible Architecture
Uses a layered structure (Facade/Service/Requests/Data) so you can extend or customize behaviors without touching public APIs.
Laravel 11/12 Compatibility
Maintains compatibility with the latest Laravel versions and modern PHP runtimes.
Rate Limit Handling
Supports automatic backoff, exposes rate limit state, and raises a dedicated exception when rate limits are exceeded.
Compatibility
- Laravel: 11, 12
- PHP: 8.2+
- Dependencies:
illuminate/contracts,spatie/laravel-dataare aligned for Laravel 11/12 support
Support Policy
- Latest Laravel major version (currently 12) is supported.
- Previous major version (11) is supported when compatible with current dependencies.
- Compatibility validation status is documented below.
Verification Status
- Laravel 12: Verified via package tests (Service/Facade regression, request configuration)
- Laravel 11: Supported via dependency constraints; verification ongoing
Known Limitations
- Ship24 API availability impacts runtime behavior; errors are surfaced from the HTTP client.
- Compatibility is limited to documented Laravel/PHP versions.
Breaking Changes
- No breaking changes introduced for Laravel 12 compatibility.
- If breaking changes are required in the future, alternatives and migration steps will be documented in the release notes.
Installation
You can install the package via Composer:
composer require wheesnoza/laravel-ship24
After installing, you may publish the configuration file:
php artisan vendor:publish --provider="Wheesnoza\Ship24\Providers\Ship24ServiceProvider" --tag=config
Configuration
The package requires an API token, which you should add to your .env file:
SHIP24_ACCESS_TOKEN=your-access-token
Usage
Retrieve a Tracker by ID
use Wheesnoza\Ship24\Facades\Ship24; $tracker = Ship24::tracker('TRACKER_ID');
Retrieve Multiple Trackers
use Wheesnoza\Ship24\Facades\Ship24; $trackers = Ship24::trackers();
Create a New Tracker
use Wheesnoza\Ship24\Facades\Ship24; $tracker = Ship24::createTracker('TRACKING_NUMBER');
Rate Limit Handling
Rate Limit Handling provides automatic backoff based on RateLimit headers and exposes the latest rate limit information for monitoring and logging. It also raises a dedicated exception when rate limit exhaustion persists.
Configuration
SHIP24_RATE_LIMIT_ENABLED=true SHIP24_RATE_LIMIT_MAX_ATTEMPTS=3 SHIP24_RATE_LIMIT_BASE_DELAY_SECONDS=2 SHIP24_RATE_LIMIT_MAX_DELAY_SECONDS=60
Accessing Rate Limit Information
Use the following to retrieve the latest rate limit information captured from the most recent API response.
use Wheesnoza\Ship24\Facades\Ship24; $rateLimit = Ship24::rateLimit();
Behavior
- If RateLimit headers are missing, the package falls back to the default backoff settings.
- If rate limiting persists beyond the maximum attempts, a dedicated exception is raised.
Testing
To run the tests, execute the following command:
composer test
Contributing
Contributions are welcome! If you find a bug or have a feature request, please open an issue on GitHub.
License
This package is open-sourced software licensed under the MIT license.
wheesnoza/laravel-ship24 适用场景与选型建议
wheesnoza/laravel-ship24 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 08 月 31 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「package」 「api」 「laravel」 「tracking」 「ship24」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 wheesnoza/laravel-ship24 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 wheesnoza/laravel-ship24 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 wheesnoza/laravel-ship24 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PSR-7 compatible library for making CRUD API endpoints
Simple ASCII output of array data
Alfabank REST API integration
Package for view storage in laravel
User Approval Laravel Package
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-08-31