PHP code example of webapix / laravel-mygls

1. Go to this page and download the library: Download webapix/laravel-mygls 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/ */

    

webapix / laravel-mygls example snippets

bash
php artisan vendor:publish --provider="Webapix\GLS\Laravel\MyGlsServiceProvider"
 php
use \Webapix\GLS\Requests\GetParcelStatuses;

$request = new GetParcelStatuses(12345678);

/** @var \Webapix\GLS\Responses\GetParcelStatuses $response */
$response = app(\Webapix\GLS\Laravel\Client::class)->request($request);
// Or use the facade: $response = MyGls::request($request);

if ($response->successfull()) {

    /** @var \Webapix\GLS\Models\ParcelStatus[] */
    $parcelStatusList = $response->parcelStatusList();

    foreach ($parcelStatusList as $parcelStatus) {
        $parcelStatus->depotCity();
        $parcelStatus->depotNumber();
        $parcelStatus->statusCode();
        $parcelStatus->statusDate();
        $parcelStatus->statusDescription();
        $parcelStatus->statusInfo();
    }

}