PHP code example of signifly / gls-parcel-shop

1. Go to this page and download the library: Download signifly/gls-parcel-shop 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/ */

    

signifly / gls-parcel-shop example snippets


$client = GLSParcelShop::make('http://www.gls.dk/webservices_v4/wsShopFinder.asmx?WSDL');

use Signifly\ParcelShop\Contracts\ParcelShop;

$client = app(ParcelShop::class);

$client->all('DK'); // returns Illuminate\Support\Collection

$parcelShop = $client->find(12345); // returns Signifly\ParcelShop\Resources\ParcelShop

// The following getters are available for ParcelShop:
$parcelShop->number();
$parcelShop->company();
$parcelShop->streetName();
$parcelShop->streetName2();
$parcelShop->zipCode();
$parcelShop->city();
$parcelShop->countryCode();
$parcelShop->latitude();
$parcelShop->longitude(); 

$parcelShop->openingHours(); // returns a collection of OpeningHour resources

// Only available if you find parcel shops near an address
$parcelShop->distance(); // 875
$parcelShop->distanceInKm(); // 0.875

// Available getters for the OpeningHour resource
$openingHour->day(); // Monday
$openingHour->from(); // 08:00
$openingHour->to(); // 20:00

// Params: Street, Zip Code, Country Code, Amount (optional, default to 5)

$client->nearest('Vesterbrogade 44', '1620', 'DK', 10); // returns Illuminate\Support\Collection

$client->within('1620', 'DK'); // returns Illuminate\Support\Collection
bash
php artisan vendor:publish --tag="parcel-shop-config"