A Laravel package for managing TrackingMore API.
TrackingMore helps eCommerce businesses to update and manage their shipment with efficiency.
This package is a wrapper of TrackingMore API PHP SDK for Laravel.
- PHP: 8.0 | 8.1 | 8.2
- Laravel: 10.0
You can install using composer from Packagist.
$ composer require anvari182/laravel-tracking-more
Add TRACKING_MORE_API_KEY
in your .env file.
Get your TrackingMore API key from TrackingMore
php artisan vendor:publish --provider="Anvari182\TrackingMore\TrackingMoreServiceProvider" --tag="config"
Inject the Tracking or Courier where you need:
use Anvari182\TrackingMore\TrackingMoreRequests\Tracking;
use Anvari182\TrackingMore\TrackingMoreRequests\Courier;
use Anvari182\TrackingMore\Data\TrackingData;
public function __construct(private Tracking $tracking, private Courier $courier)
{
}
public function index()
{
// Create a tracking
$this->tracking->createTracking(['tracking_number' => 'xyz123', 'courier_code' => 'ups']);
// Get all couriers
$couriers = $this->courier->getAllCouriers();
}
Or use it with Facade:
use Anvari182\TrackingMore\Facades\TrackingMore;
// Create a tracking
TrackingMore::tracking()->createTracking(['tracking_number' => 'xyz123', 'courier_code' => 'ups'])
// Get all couriers
$couriers = TrackingMore::courier()->getAllCouriers();
TrackingMore::tracking()->createTracking(['tracking_number' => 'xyz123', 'courier_code' => 'ups'])
TrackingMore::tracking()->getTrackingResults()
Create multiple trackings (Max. 40 tracking numbers create in one call).
TrackingMore::tracking()->batchCreateTrackings([
['tracking_number' => 'xyz1234', 'courier_code' => 'ups'],
['tracking_number' => 'xyz1235', 'courier_code' => 'ups'],
['tracking_number' => 'xyz1236', 'courier_code' => 'ups'],
]);
Tracking ID
TrackingMore::tracking()->updateTrackingByID('13123213213213', ['note' => 'New test order note', 'customer_name'=>'New name'])
Tracking ID
TrackingMore::tracking()->deleteTrackingByID('13123213213213')
Tracking ID
TrackingMore::tracking()->retrackTrackingByID('13123213213213')
Return a list of matched couriers based on submitted tracking number.
TrackingMore::courier()->detect(['tracking_number' => '9261290312833844954982'])
Return a list of all supported couriers.
TrackingMore::courier()->getAllCouriers()
TrackingMore API PHP SDK v.1.0.0
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
This project is licensed under the MIT License - see the LICENSE file for details.