PHP code example of noxxie / ptv-laravel

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

    

noxxie / ptv-laravel example snippets


'providers' => [
     ...
     Noxxie\Ptv\PtvServiceProvider::class,
];

...
'ptv'  =>  [
    'driver'            =>  'sqlsrv',
    'host'              =>  '',
    'port'              =>  '1433',
    'database'          =>  '',
    'username'          =>  '',
    'password'          =>  '',
    'charset'           =>  'utf8',
    'prefix'            =>  '',
    'prefix_indexes'    =>  true,
],
...

'IORA_ORDER_ACTIONPOINT'  =>  [
    'postcode'      =>  'IORA_POSTCODE',
    'city'          =>  'IORA_CITY',
    'country'       =>  'IORA_COUNTRY',
    'street'        =>  'IORA_STREET',
    'houseno'       =>  'IORA_HOUSENO',
    'timewindow'    =>  'IORA_HANDLINGTIME_CLASS',
    'from'          =>  'IORA_EARLIEST_DATETIME',
    'till'          =>  'IORA_LATEST_DATETIME',
],


...
use Noxxie\Ptv\Contracts\Order;
use Noxxie\Ptv\Contracts\Route;

...

public function mockup(Route $route) {
    $order->create(...);
}

public function mockup_order(Order $order) {
    $route->getNotImported();
}

$route = App()->Make('Noxxie\Ptv\Contracts\Route');
$order = App()->Make('Noxxie\Ptv\Contracts\Order');

$order = App()->MakeWith('Noxxie\Ptv\Contracts\Order', [
    'type' => 'CREATE',
    'attributes' => [...],
]);

$route= App()->MakeWith('Noxxie\Ptv\Contracts\Route', [
    'id' => '123456',
];


...
use Noxxie\Ptv\Facades\Order;
use Noxxie\Ptv\Facades\Route;

...

public function mockup() {
    $Order = Order::create(...);
    $Route = Route::getNotImported();
}