1. Go to this page and download the library: Download devmapr/laravel-shipping 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/ */
devmapr / laravel-shipping example snippets
use Planx\Shipping\Facades\Shipping;
// Resolve a driver by name
$shipping = Shipping::driver('tinex');
// Submit an order (driver-specific payload)
$result = $shipping->submit($order, [
'parcel_size_id' => 3,
'is_self_pickup' => true,
]);
use Planx\Shipping\Contracts\ShippingDriver;
class MyCourierDriver implements ShippingDriver
{
public function createParcel(array $payload): array { /* ... */ }
public function updateParcel(int|string $id, array $payload): array { /* ... */ }
public function getParcel(int|string $id): array { /* ... */ }
public function deleteParcel(int|string $id): array { /* ... */ }
public function getDays(): array { /* ... */ }
public function getDaysIndex(): array { /* ... */ }
}