This is the Laravel version of our MyGLS REST API integration.
You can install the package via composer:
composer require webapix/laravel-mygls
Create config/my-gls.php configuration file using the following artisan command:
php artisan vendor:publish --provider="Webapix\GLS\Laravel\MyGlsServiceProvider"
Open .env file and set:
MYGLS_API_URL
MYGLS_CLIENT_NUMBER
MYGLS_USERNAME
MYGLS_PASSWORD
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();
}
}
You can find more information and examples in our wiki.
By default, the MyGLS client use the default account.
You can use multiple accounts:
// add your new account to config/my-gls.php
[
'accounts' => [
'my-new-account' => [
'api_url' => '',
'client_number' => '',
'username' => '',
'password' => '',
]
]
]
MyGls::on('my-new-account')->request(...);
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.