An unofficial lightweight PHP SDK for the MyGLS REST API.
You can install the package via composer:
composer require webapix/mygls-sdk
use GuzzleHttp\Client as HttpClient;
use Webapix\GLS\Client;
use Webapix\GLS\Models\Parcel;
use Webapix\GLS\Services\SMS;
use Webapix\GLS\Requests\PrintLabels;
$parcel = (new Parcel)
->setClientNumber(123456789)
->setPickupAddress(<class that extends \Webapix\GLS\Contracts\Address>)
->setDeliveryInfo(<class that extends \Webapix\GLS\Contracts\Contact>)
->when($order->cutomerWantsSmsAlert(), function (Parcel $parcel) use ($order) {
return $parcel->addService(
new SMS($order->phone_number, 'Your package (#ParcelNr#) is on its way to GLS facility!')
);
});
$client = new Client(new HttpClient);
$request = PrintLabels;
$request->addParcel($parcel);
/** @var \Webapix\GLS\Responses\PrintLabels $response */
$response = $client->on($account)->request($request);
if ($response->successfull()) {
// get the pdf
$response->getPdf();
}
You can find more information and examples in our wiki.
Package docs
Official GLS Docs
composer test
According to the postcardware concept, if you use the software for your project(s) we would appreciate to receive a postcard of your hometown.
Please send it to:
WEBAPIX KFT.
Kőris utca 2/E, 2/1
2051 Biatorbágy
Hungary
If you find our packages useful and would like to support our work in maintaining and regularly updating them, consider becoming a patron. Any size of donation is welcome and highly appreciated.
Contributions are welcome! When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
Please see CHANGELOG for more information on what has changed recently.
If you discover any security related issues, please email pdo@webapix.hu instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.