PHP code example of anvari182 / laravel-tracking-more

1. Go to this page and download the library: Download anvari182/laravel-tracking-more library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

anvari182 / laravel-tracking-more example snippets


php artisan vendor:publish --provider="Anvari182\TrackingMore\TrackingMoreServiceProvider" --tag="config"


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();
}

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()

 TrackingMore::tracking()->batchCreateTrackings([
        ['tracking_number' => 'xyz1234', 'courier_code' => 'ups'],
        ['tracking_number' => 'xyz1235', 'courier_code' => 'ups'],
        ['tracking_number' => 'xyz1236', 'courier_code' => 'ups'],
    ]);

TrackingMore::tracking()->updateTrackingByID('13123213213213', ['note' => 'New test order note', 'customer_name'=>'New name'])

TrackingMore::tracking()->deleteTrackingByID('13123213213213')

TrackingMore::tracking()->retrackTrackingByID('13123213213213')

TrackingMore::courier()->detect(['tracking_number' => '9261290312833844954982'])

TrackingMore::courier()->getAllCouriers()