alexanderpoellmann / laravel-post-plc
A laravel integration for the Austrian Post Label Center (Österreichische Post).
Installs: 1 092
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 1
pkg:composer/alexanderpoellmann/laravel-post-plc
Requires
- php: ^8.1
- illuminate/contracts: ^10.0||^11.0||^12.0
- ricorocks-digital-agency/soap: ^3.0
- spatie/laravel-data: ^4.14
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^2.9||^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^10.0.0||^9.0.0||^8.22.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- phpstan/extension-installer: ^1.3||^2.0
- phpstan/phpstan-deprecation-rules: ^1.1||^2.0
- phpstan/phpstan-phpunit: ^1.3||^2.0
- spatie/laravel-ray: ^1.35
This package is auto-updated.
Last update: 2025-10-13 00:06:00 UTC
README
Installation
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), ],
Usage
use AlexanderPoellmann\LaravelPostPlc\Classes\Address; use AlexanderPoellmann\LaravelPostPlc\Classes\Collo; use AlexanderPoellmann\LaravelPostPlc\Classes\Shipment; use AlexanderPoellmann\LaravelPostPlc\Facades\LaravelPostPlc; use AlexanderPoellmann\LaravelPostPlc\Enums\PostProductCodes; use AlexanderPoellmann\LaravelPostPlc\Enums\ServiceMethods; $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);
The PostProductCodes
enum has a few helper methods to make it easier to decide which options you might show to your users, when creating shipments:
use AlexanderPoellmann\LaravelPostPlc\Enums\PostProductCodes; // check whether the selected product is available for Austrian addresses only $isDomestic = PostProductCodes::PaketOesterreich->isDomestic(); // check whether the selected product requires you to specify its weight $requiresWeight = PostProductCodes::PaketPremiumInternational->requiresWeight(); // check whether the selected product is available only for business-to-business shipments $forBusinessOnly = PostProductCodes::PaketPremiumOesterreichB2B->forBusinessOnly();
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.