PHP code example of smart-dato / brt-documento-di-ritiro
1. Go to this page and download the library: Download smart-dato/brt-documento-di-ritiro 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/ */
smart-dato / brt-documento-di-ritiro example snippets
use SmartDato\BrtDocumentoDiRitiro\Data\AddressData;
use SmartDato\BrtDocumentoDiRitiro\Data\BrandingData;
use SmartDato\BrtDocumentoDiRitiro\Data\ParcelData;
use SmartDato\BrtDocumentoDiRitiro\Data\PickupData;
use SmartDato\BrtDocumentoDiRitiro\Data\ShipmentData;
use SmartDato\BrtDocumentoDiRitiro\Facades\BrtDocumentoDiRitiro;
$result = BrtDocumentoDiRitiro::document()
->pickup(new PickupData(
documentNumber: 'OLP202600044200',
documentDate: '2026-08-24',
))
->sender(new AddressData(
personName: 'Mario Balistreri',
street: 'Via Venezia 22',
zipcode: '94100',
city: 'Enna',
countryCode: 'it',
countryName: 'Italy',
phone: '3476221921',
))
->branding(new BrandingData(
termsUrl: 'www.example.com',
sideLogoPath: '/path/to/your/side-logo.png',
))
->clientCode('0123456')
->addShipment(new ShipmentData(
key: 'SHIP0001',
deliveryAddress: new AddressData(/* ... */),
onBehalfOf: 'Your Company',
declaredParcelCount: 2,
parcels: [
new ParcelData(key: 'SHIP0001X1', weight: 10.0, volume: 0.04),
new ParcelData(key: 'SHIP0001X2', weight: 10.0, volume: 0.07),
],
useBarcodeSideLayout: true,
))
->generate();
$result->documentPdf(); // corriere pages + all parcel labels, merged
$result->corrierePdf(); // corriere pages only
$result->parcelLabels(); // parcel key => label PDF (newly rendered labels)
$result->barcodes(); // parcel key => segnacollo barcode (all parcels)
$result->allocatedBarcodes(); // parcel key => BarcodeAllocation (newly allocated only)
$result->labeledParcelKeys(); // parcels that received a label in this run