PHP code example of patryk-sawicki / orlenpaczka-laravel

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

    

patryk-sawicki / orlenpaczka-laravel example snippets


<x-op::map-button/>

OP_API_ID = 'your_partner_id'
OP_API_KEY = 'your_partner_key'
OP_SANDBOX = false // optional - default false
OP_CACHE_DEFAULT_TTL = 86400 // optional - default 86400 seconds

use PatrykSawicki\OrlenPaczkaApi\app\Classes\OrlenPaczka;

OrlenPaczka::giveMeAllRUCHWithFilled()->list(); // return array

[
    [
        'DestinationCode' => 'WS-100001-27-26',
        'StreetName' => 'ANNOPOL 17 TEST',
        'City' => 'Warszawa',
        'District' => 'Warszawa',
        'Latitude' => '52.311519',
        'Longitude' => '21.013830',
        'Province' => 'Mazowieckie',
        'CashOnDelivery' => 'true',
        'OpeningHours' => 'Pn-Pt:00:00-24:00, So:00:00-24:00, Nd:00:00-24:00',
        'Location' => 'Punkt testowy',
        'PSD' => '100001',
        'PointType' => 'PSD',
        'Filled' => 'false',
        'Suggestions' => [],
        'Available' => 'true',
        'ZipCode' => '03-236',
    ],
    ...
]

OrlenPaczka::generateLabelBusinessPack()->pdf(array $data); // return ?

[
    [
        'DestinationCode' => 'WS-100001-27-26',
        'BoxSize' => 'S', // S, M, L
        'FirstName' => 'Jan',
        'LastName' => 'Kowalski',
        'PhoneNumber' => '123456789',
        'EMail' => '[email protected]',
        'SenderEMail' => '[email protected]',
        'SenderFirstName' => 'Jan',
        'SenderLastName' => 'Kowalski',
        'SenderStreetName' => 'Testowa 1',
        'SenderBuildingNumber' => '1',
        'SenderCity' => 'Warszawa',
        'SenderPostCode' => '00-001',
        'SenderPhoneNumber' => '123456789',
        'PrintAdress' => '1', // 1, 2
        'PrintType' => '1', // 1, 2
    ],
    ...
]

// return pdf

<x-op::labels-panel 
    :destination-code=""
    :firstName=""
    :lastName=""
    :phoneNumber=""
    :email=""
    :senderEMail=""
    :senderFirstName=""
    :senderLastName=""
    :senderStreetName=""
    :senderBuildingNumber=""
    :senderCity=""
    :senderPostCode=""
    :senderPhoneNumber=""
    :disc=""
    :dir=""
    :file=""
/>