PHP code example of mchervenkov / sameday

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

    

mchervenkov / sameday example snippets



// Init Sameday Client
$sameday = new Sameday();

// Client endpoints
$sameday->getServices();
$sameday->getPickupPoints();
$sameday->getAwbStatus();
$sameday->syncStatus();

// Geolocation endpoints
$sameday->getCounties();
$sameday->getCities();

// Lockers endpoints
$sameday->getLockers();

SamedayCity
SamedayCounty
SamedayApiStatus
SamedayLocker
CarrierCityMap

$sameday = new Sameday();
$response = $sameday->getCities();
dd($response);


$sameday = new Sameday();
$cityHydrator = new City(['countyCode' => 'BG']);
$response = $sameday->getCities($cityHydrator);
dd($response);

$sameday = new Sameday();
$cityHydrator = new City(['countyCode' => 'BG']);
$paginator = new Paginator(1, 50);
$response = $sameday->getCities($cityHydrator, $paginator);
dd($response);
bash
php artisan migrate
bash
php artisan vendor:publish --tag=sameday-config
bash
php artisan vendor:publish --tag=sameday-migrations
bash
php artisan vendor:publish --tag=sameday-models
bash
php artisan vendor:publish --tag=sameday-commands