You can install the package via composer:
composer require alexanderpoellmann/laravel-post-plc
You can publish and run the migrations with:
php artisan vendor:publish --tag="laravel-post-plc-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="laravel-post-plc-config"
Finally, add the following entry to your services.php
config file:
'post-plc' => [
'client-id' => env('PLC_CLIENT_ID'),
'org-unit-id' => env('PLC_ORG_UNIT_ID'),
'org-unit-guid' => env('PLC_ORG_UNIT_GUID'),
'sandbox' => env('PLC_SANDBOX', false),
],
use AlexanderPoellmann\LaravelPostPlc\Classes\Address;
use AlexanderPoellmann\LaravelPostPlc\Classes\Collo;
use AlexanderPoellmann\LaravelPostPlc\Classes\Shipment;
use AlexanderPoellmann\LaravelPostPlc\Facades\LaravelPostPlc;
$from = (new Address())
->id(sprintf('%05d', mt_rand(1, 10000)))
->name('Absender GmbH')
->route('Rochusmarkt')
->street_number('5')
->post_code('1030')
->city('Wien')
->country_code('AT')
->get();
$to = (new Address())
->id(sprintf('%05d', mt_rand(1, 10000)))
->name('Musterfirma GmbH', 'c/o Frau Maria Muster')
->route('Landesgerichtsstraße')
->street_number('1')
->post_code('1010')
->city('Wien')
->country_code('AT')
->get();
$shipment = (new Shipment())
->withPrinter()
->withNumber(sprintf('%05d', mt_rand(1, 10000)))
->using(PostProductCodes::PaketPremiumOesterreichB2B)
->from($from)
->to($to)
->parcels([
(new Collo())->weight(0.4)->get(),
(new Collo())->weight(5.2)->get(),
])->get();
LaravelPostPlc::call(ServiceMethods::ImportShipment, $shipment, true);
$object = LaravelPostPlc::toCollection();
dd($object);
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.