1. Go to this page and download the library: Download cloudenum/laravel-biteship 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/ */
cloudenum / laravel-biteship example snippets
// First you must define the items to ship
$items = [
[
'name' => 'Black L',
'description' => 'White Shirt',
'category' => 'fashion',
'value' => 165000,
'quantity' => 1,
'height' => 10,
'length' => 10,
'weight' => 200,
'width' => 10,
]
];
// Then specify the destination and the origin
// You could use Postal Code but Biteship recommends you to use
// their's Area ID, because it is more accurate.
$destination = 12950;
$origin = 12440;
$availableCouriers = \Cloudenum\Biteship\Courier::all();
$rates = \Cloudenum\Biteship\CourierPricing::Rates([
'origin_postal_code' => $origin,
'destination_postal_code' => $destination,
'couriers' => implode(',', $availableCouriers->pluck('courier_code')->unique()->toArray()),
'items' => $items,
]);