1. Go to this page and download the library: Download beziworld/laravel-polkurier 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/ */
beziworld / laravel-polkurier example snippets
use Beziworld\Polkurier\Data\Address;
use Beziworld\Polkurier\Data\OrderRequest;
use Beziworld\Polkurier\Data\Pack;
use Beziworld\Polkurier\Enums\Service;
use Beziworld\Polkurier\Facades\Polkurier;
$carriers = Polkurier::carriers(details: true); // list<Carrier>
$dpd = Polkurier::carrier('DPD');
$dpd?->supportsCod();
$dpd?->supportsService('ROD');
$dpd?->additionalFields(); // carrier specific order fields
$quote = new OrderRequest(
sender: Address::postcode('63-400'),
recipient: Address::postcode('60-001'),
packs: [new Pack(length: 30, width: 20, height: 10, weight: 2.5)],
services: [Service::SmsNotification],
);
foreach (Polkurier::valuation($quote) as $price) {
$price->carrier; // "DPD"
$price->priceGross; // "14.76"
$price->available; // false with $price->unavailableMessage when the carrier cannot take it
}
$best = Polkurier::cheapest($quote);
use Beziworld\Polkurier\Data\Cod;
use Beziworld\Polkurier\Data\Pickup;
use Beziworld\Polkurier\Enums\CodReturnTime;
$order = Polkurier::createOrder(new OrderRequest(
sender: new Address('Jan Kowalski', 'Kurierska', '1', '63-400', 'Ostrów Wielkopolski', '500600700', '[email protected]', company: 'ACME'),
recipient: new Address('Anna Nowak', 'Poznańska', '12', '60-001', 'Poznań', '600700800', '[email protected]', pointId: 'POZ01M'),
packs: [new Pack(30, 20, 10, 2.5)],
courier: 'INPOST_PACZKOMAT',
description: 'Books',
cod: new Cod('149.99', 'PL61109010140000071219812874', CodReturnTime::OneDay),
insurance: 200,
pickup: Pickup::dropOff(), // or Pickup::at('2026-11-12', '10:00', '14:00') or Pickup::multi()
externalApplicationId: 'my-shop',
externalOrderId: 'A-1001',
));
$order->orderNumber; // "1234-10"
$order->waybill(); // "13299300045383"
$order->priceGross; // "12.30"
$pdf = Polkurier::label($order->orderNumber); // or label(['1234-10', '1234-11']) merged into one PDF
$protocol = Polkurier::protocol(['1234-10', '1234-11']);
Polkurier::cancelOrder('1234-10'); // orders waiting for payment or confirmed
use Beziworld\Polkurier\Enums\ShipmentType;
$day = Polkurier::pickupHours('DPD', '2026-11-12', '63-400'); // PickupDate: available, windows
$days = Polkurier::pickupDates('DPD', ShipmentType::Box, '63-400'); // next five working days
// Orders created with Pickup::multi() share one courier pickup:
$waiting = Polkurier::orders(['status' => 'PZ']);
$result = Polkurier::multiPickup(['1234-56', '1234-78'], '2026-11-12', '10:00', '15:00');
$result->failed; // ['1234-78' => 'error message']