New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

ivanmitrikeski/laravel-shipping

Shipping package for Laravel. Supported providers: CanadaPost, USPS, UPS, FedEx and Purolator.
40,489 25

Larablocks Analysis

ivanmitrikeski/laravel-shipping works with Laravel 11, 12 and 13 (latest release v1.0.11, Oct 25, 2026).

Laravel 10 in earlier releases.

Recommendation checks

Solid choice

Solid choice: maintained and up to date, meets 2 of 4 checks; below the bar for Recommended on use.

  • Works with Laravel 13, the current version
  • Released in the last 12 months (Oct 25, 2026)
  • 4,230 downloads a month (needs 10,000)
  • 25 GitHub stars (needs 100)

State

Actively maintained
  • Last stable release: Oct 25, 2026.
  • 4 releases in the last 12 months.
  • First released: Sep 25, 2023.
  • Monthly downloads: 4,230, down 58% from six months ago.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 1, 2026.

Install
composer require ivanmitrikeski/laravel-shipping
Latest Version:v1.0.11
PHP:^8.2
Laravel:11 · 12 · 13
Older releases:10
License:MIT
Last Updated:Nov 23, 2026
Links: GitHub  ·  Packagist
Maintainer: ivanmitrikeski

Shipping package for Laravel

Supported shipping providers:

  • UPS REST/OAuth API
  • FedEx REST/OAuth API
  • Canada Post
  • USPS API v3
  • Purolator

Package can be used outside the Laravel environment as well (by making individual shipping provider requests).

Supported API services:

Shipping Provider Rate API Shipment API
UPS REST ✓ ✓
FedEx REST ✓ ✓
Canada Post ✓ ✓
Purolator ✓ ✓
USPS API v3 ✓ (Shipping Options 3.0) -

Install package

composer require ivanmitrikeski/laravel-shipping

Run migrations

php artisan migrate

Setup .env variables

CANADA_POST_CUSTOMER_NUMBER=
CANADA_POST_USERNAME=
CANADA_POST_PASSWORD=

PUROLATOR_KEY=
PUROLATOR_PASSWORD=
PUROLATOR_BILLING_ACCOUNT=
PUROLATOR_REGISTERED_ACCOUNT=
PUROLATOR_USER_TOKEN=

UPS_CLIENT_ID=
UPS_CLIENT_SECRET=
UPS_USER_ID=
UPS_ACCOUNT_NUMBER=

USPS_CLIENT_ID=
USPS_CLIENT_SECRET=

FEDEX_CLIENT_ID=
FEDEX_CLIENT_SECRET=
FEDEX_ACCOUNT_NUMBER=

SHIPPING_SANDBOX=false

Database Table Prefix

By default, Laravel Shipping adds laravel_shipping_ to all database table names to avoid conflicts with existing tables.

You can change the prefix in your .env file:

LARAVEL_SHIPPING_TABLE_PREFIX=custom_prefix_
Upgrading from an Older Version

Older versions of Laravel Shipping created tables without a prefix.

If you already use Laravel Shipping, add this to your .env file before updating:

LARAVEL_SHIPPING_TABLE_PREFIX=

This keeps your existing table names, so you don't need to rename any tables.

If your application uses cached configuration, run:

php artisan config:clear

New installations: No changes are needed. The default prefix is laravel_shipping_.

Using sandbox credentials

In order to use test credentials just add param "true" in the *Credentials() object or set environment variable SHIPPING_SANDBOX=false.

Models

There are 4 Eloquent models available: ShippingService, ShippingBox, ShippingOption and ShippingOptionPrice.

ShippingBox and ShippingOptionPrice are used for service Flat. Creating ShippingBox and creating ShippingOptionPrice will allow users to set flat rate shipping prices.

Shipping Quotes

Retrieve all shipping rates, for all enabled shipping providers.
$exceptions = [];

$rates = app(\Mitrik\Shipping\Facades\Shipping::class)->rates(
    new Address(
        'Ivan',
        'Mitrikeski',
        '',
        '321 Lakeshore Rd W',
        '',
        'Mississauga',
        'L5H 1G0',
        'ON',
        'CA'
    ),
    new Address(
        'Ivan',
        'Mitrikeski',
        '',
        '100 City Centre Dr',
        '',
        'Mississauga',
        'L5B 2C9',
        'ON',
        'CA'
    ),
    new \Mitrik\Shipping\ServiceProviders\Box\BoxCollection([
        new BoxMetric(20, 10, 5, 1)
    ]),
    $exceptions
);

Fourth parameter $exceptions is optional. If provided function will push all exception to provided array. If not provided, an exception will be thrown each time there is an issue retrieving a quote.

Canada Post
use Mitrik\Shipping\ServiceProviders\Address\Address;
use Mitrik\Shipping\ServiceProviders\Box\BoxCollection;
use Mitrik\Shipping\ServiceProviders\Box\BoxMetric;
use Mitrik\Shipping\ServiceProviders\ServiceCanadaPost\ServiceCanadaPost;
use Mitrik\Shipping\ServiceProviders\ServiceCanadaPost\ServiceCanadaPostCredentials;

$credentials = new ServiceCanadaPostCredentials(env('CANADA_POST_CUSTOMER_NUMBER'), env('CANADA_POST_USERNAME'), env('CANADA_POST_PASSWORD'));
$canadaPost = new ServiceCanadaPost($credentials);

$rates = $canadaPost->rate(
    new Address(
        'Ivan',
        'Mitrikeski',
        '',
        '321 Lakeshore Rd W',
        '',
        'Mississauga',
        'L5H 1G0',
        'ON',
        'CA'
    ),
    new Address(
        'Ivan',
        'Mitrikeski',
        '',
        '100 City Centre Dr',
        '',
        'Mississauga',
        'L5B 2C9',
        'ON',
        'CA'
    ),
    new BoxCollection([
        new BoxMetric(20, 10, 5, 1)
    ])
);
Purolator
use Mitrik\Shipping\ServiceProviders\Address\Address;
use Mitrik\Shipping\ServiceProviders\Box\BoxCollection;
use Mitrik\Shipping\ServiceProviders\Box\BoxMetric;
use Mitrik\Shipping\ServiceProviders\ServicePurolator\ServicePurolator;
use Mitrik\Shipping\ServiceProviders\ServicePurolator\ServicePurolatorCredentials;

$credentials = new ServicePurolatorCredentials(env('PUROLATOR_KEY'), env('PUROLATOR_PASSWORD'), env('PUROLATOR_BILLING_ACCOUNT'), env('PUROLATOR_REGISTERED_ACCOUNT'), env('PUROLATOR_USER_TOKEN'), env('PUROLATOR_SANDBOX'));
$purolator = new ServicePurolator($credentials);

$rates = $purolator->rate(
    new Address(
        'Ivan',
        'Mitrikeski',
        '',
        '321 Lakeshore Rd W',
        '',
        'Mississauga',
        'L5H 1G0',
        'ON',
        'CA'
    ),
    new Address(
        'Ivan',
        'Mitrikeski',
        '',
        '100 City Centre Dr',
        '',
        'Mississauga',
        'L5B 2C9',
        'ON',
        'CA'
    ),
    new BoxCollection([
        new BoxMetric(20, 10, 5, 1)
    ])
);

UPS
use Mitrik\Shipping\ServiceProviders\Address\Address;
use Mitrik\Shipping\ServiceProviders\Box\BoxCollection;
use Mitrik\Shipping\ServiceProviders\Box\BoxMetric;
use Mitrik\Shipping\ServiceProviders\ServiceUPS\ServiceUPS;
use Mitrik\Shipping\ServiceProviders\ServiceUPS\ServiceUPSCredentials;

$credentials = new ServiceUPSCredentials(env('UPS_CLIENT_ID'), env('UPS_CLIENT_SECRET'), env('UPS_USER_ID'), env('UPS_ACCOUNT_NUMBER'));
$serviceUPS = new ServiceUPS($credentials);

$rates = $serviceUPS->rate(
    new Address(
        'Ivan',
        'Mitrikeski',
        '',
        '321 Lakeshore Rd W',
        '',
        'Mississauga',
        'L5H 1G0',
        'ON',
        'CA'
    ),
    new Address(
        'Ivan',
        'Mitrikeski',
        '',
        '100 City Centre Dr',
        '',
        'Mississauga',
        'L5B 2C9',
        'ON',
        'CA'
    ),
    new BoxCollection([
        new BoxMetric(20, 10, 5, 1)
    ])
);
USPS
use Mitrik\Shipping\ServiceProviders\Address\Address;
use Mitrik\Shipping\ServiceProviders\Box\BoxCollection;
use Mitrik\Shipping\ServiceProviders\Box\BoxMetric;
use Mitrik\Shipping\ServiceProviders\ServiceUSPS\ServiceUSPS;
use Mitrik\Shipping\ServiceProviders\ServiceUSPS\ServiceUSPSCredentials;

$credentials = new ServiceUSPSCredentials(env('USPS_CLIENT_ID'), env('USPS_CLIENT_SECRET'));
$usps = new ServiceUSPS($credentials);

$rates = $usps->rate(
    new Address(
        'Ivan',
        'Mitrikeski',
        '',
        '1 Wall St',
        '',
        'New York',
        '10005',
        'NY',
        'US'
    ),
    new Address(
        'Ivan',
        'Mitrikeski',
        '',
        '1 Wall St',
        '',
        'New York',
        '10005',
        'NY',
        'US'
    ),
    new BoxCollection([
        new BoxMetric(20, 10, 5, 1)
    ])
);
FedEx
use Mitrik\Shipping\ServiceProviders\Address\Address;
use Mitrik\Shipping\ServiceProviders\Box\BoxCollection;
use Mitrik\Shipping\ServiceProviders\Box\BoxMetric;
use Mitrik\Shipping\ServiceProviders\ServiceFedEx\ServiceFedEx;
use Mitrik\Shipping\ServiceProviders\ServiceFedEx\ServiceFedExCredentials;

$credentials = new ServiceFedExCredentials(env('FEDEX_CLIENT_ID'), env('FEDEX_CLIENT_SECRET'), env('FEDEX_ACCOUNT_NUMBER'));
$fedEx = new ServiceFedEx($credentials);

$rates = $fedEx->rate(
    new Address(
        'Ivan',
        'Mitrikeski',
        '',
        '1 Wall St',
        '',
        'New York',
        '10005',
        'NY',
        'US'
    ),
    new Address(
        'Ivan',
        'Mitrikeski',
        '',
        '1 Wall St',
        '',
        'New York',
        '10005',
        'NY',
        'US'
    ),
    new BoxCollection([
        new BoxMetric(20, 10, 5, 1)
    ])
);
Flat
use Mitrik\Shipping\ServiceProviders\Address\Address;
use Mitrik\Shipping\ServiceProviders\Box\BoxCollection;
use Mitrik\Shipping\ServiceProviders\Box\BoxMetric;
use Mitrik\Shipping\ServiceProviders\ServiceFlat\ServiceFlat;



$flat = new ServiceFlat();

$rates = $flat->rate(
    new Address(
        'Ivan',
        'Mitrikeski',
        '',
        '321 Lakeshore Rd W',
        '',
        'Mississauga',
        'L5H 1G0',
        'ON',
        'CA'
    ),
    new Address(
        'Ivan',
        'Mitrikeski',
        '',
        '100 City Centre Dr',
        '',
        'Mississauga',
        'L5B 2C9',
        'ON',
        'CA'
    ),
    new BoxCollection([
        new BoxMetric(35, 26, 5, 1)
    ])
);
Creating shipping boxes
$modelShippingBox = new ShippingBox();
$modelShippingBox->length = 35;
$modelShippingBox->width = 26;
$modelShippingBox->height = 5;
$modelShippingBox->max_weight = 5;
$modelShippingBox->save();
Creating shipping option for Flat service
$modelShippingService = ShippingService::whereName('Flat')->first();

$modelShippingOption = new ShippingOption();
$modelShippingOption->shipping_service_id = $modelShippingService->id;
$modelShippingOption->code = 'FREE.PICKUP';
$modelShippingOption->name = 'Free Pickup';
$modelShippingOption->is_enabled = true;
$modelShippingOption->is_internal = false;
$modelShippingOption->save();
Creating Flat service prices
$modelShippingBox = ShippingBox::whereUuid('SOME_BOX_UUID')->first();
$modelShippingOption = ShippingOption::whereUuid('SOME_OPTION_UUID')->first();


$modelShippingOptionPrice = new ShippingOptionPrice();
$modelShippingOptionPrice->shipping_box_id = $modelShippingBox->id;
$modelShippingOptionPrice->shipping_option_id = $modelShippingOption->id;
$modelShippingOptionPrice->shipping_service_id = $modelShippingOption->shipping_service_id;
$modelShippingOptionPrice->price = 10.99;
$modelShippingOptionPrice->save();

Creating Shipments

Canada Post
use Mitrik\Shipping\ServiceProviders\Address\Address;
use Mitrik\Shipping\ServiceProviders\Box\BoxCollection;
use Mitrik\Shipping\ServiceProviders\Box\BoxMetric;
use Mitrik\Shipping\ServiceProviders\ServiceCanadaPost\ServiceCanadaPost;
use Mitrik\Shipping\ServiceProviders\ServiceCanadaPost\ServiceCanadaPostCredentials;

$credentials = new ServiceCanadaPostCredentials(env('CANADA_POST_CUSTOMER_NUMBER'), env('CANADA_POST_USERNAME'), env('CANADA_POST_PASSWORD'));
$canadaPost = new ServiceCanadaPost($credentials);

$result = $canadaPost->ship(
    new ShipFrom(
        name: 'Ivan Mitrikeski',
        attentionName: 'Ivan Mitrikeski',
        address: new Address(
            'Ivan',
            'Mitrikeski',
            '',
            '321 Lakeshore Rd W',
            '',
            'Mississauga',
            'L5H 1G0',
            'ON',
            'CA'
        ),
        phone: new Phone('+1', '555', '1231234'),
        company: 'Test'
    ),
    new ShipTo(
        'John Smith',
        'John Smith',
        new Address(
            'John',
            'Smith',
            '',
            '100 City Centre Dr',
            '',
            'Mississauga',
            'L5B 2C9',
            'ON',
            'CA'
        ),
        new Phone('+1', '555', '1231234')
    ),
    new BoxCollection([
        new BoxMetric(20, 10, 5, 1)
    ]),
    new ServiceProviderService('DOM.RP', ''),
    null,
    [
        'delivery-spec' => [
            'settlement-info' => [
                'contract-id' => '0042708517'
            ]
        ]
    ]
);
Purolator
use Mitrik\Shipping\ServiceProviders\Address\Address;
use Mitrik\Shipping\ServiceProviders\Box\BoxCollection;
use Mitrik\Shipping\ServiceProviders\Box\BoxMetric;
use Mitrik\Shipping\ServiceProviders\ServicePurolator\ServicePurolator;
use Mitrik\Shipping\ServiceProviders\ServicePurolator\ServicePurolatorCredentials;

$credentials = new ServicePurolatorCredentials(env('PUROLATOR_KEY'), env('PUROLATOR_PASSWORD'), env('PUROLATOR_BILLING_ACCOUNT'), env('PUROLATOR_REGISTERED_ACCOUNT'), env('PUROLATOR_USER_TOKEN'), env('PUROLATOR_SANDBOX'));
$purolator = new ServicePurolator($credentials);

$result = $purolator->ship(
    new ShipFrom(
        'Ivan Mitrikeski',
        'Ivan Mitrikeski',
        new Address(
            'Ivan',
            'Mitrikeski',
            '',
            '321 Lakeshore Rd W',
            '',
            'Mississauga',
            'L5H 1G0',
            'ON',
            'CA'
        ),
        new Phone('+1', '555', '1231234'),
        ''
    ),
    new ShipTo(
        'John Smith',
        'John Smith',
        new Address(
            'John',
            'Smith',
            '',
            '100 City Centre Dr',
            '',
            'Mississauga',
            'L5B 2C9',
            'ON',
            'CA'
        ),
        new Phone('+1', '555', '1231234')
    ),
    new BoxCollection([
        new BoxMetric(20, 10, 5, 1)
    ]),
    new ServiceProviderService('PurolatorExpress', '')
);
UPS
use Mitrik\Shipping\ServiceProviders\Address\Address;
use Mitrik\Shipping\ServiceProviders\Box\BoxCollection;
use Mitrik\Shipping\ServiceProviders\Box\BoxMetric;
use Mitrik\Shipping\ServiceProviders\ServiceUPS\ServiceUPS;
use Mitrik\Shipping\ServiceProviders\ServiceUPS\ServiceUPSCredentials;

$credentials = new ServiceUPSCredentials(env('UPS_ACCESS_KEY'), env('UPS_USER_ID'), env('UPS_PASSWORD'));
$serviceUPS = new ServiceUPS($credentials);

$result = $serviceUPS->ship(
    new ShipFrom(
        'Ivan Mitrikeski',
        'Ivan Mitrikeski',
        new Address(
            'Ivan',
            'Mitrikeski',
            '',
            '1 Wall St',
            '',
            'New York',
            '10005',
            'NY',
            'US'
        ),
        new Phone('+1', '555', '1231234'),
        ''
    ),
    new ShipTo(
        'John Smith',
        'John Smith',
        new Address(
            'John',
            'Smith',
            '',
            '1 Wall St',
            '',
            'New York',
            '10005',
            'NY',
            'US'
        ),
        new Phone('+1', '555', '1231234')
    ),
    new BoxCollection([
        new BoxImperial(20, 10, 5, 1)
    ]),
    new ServiceProviderService('03', '')
);
FedEx
use Mitrik\Shipping\ServiceProviders\Address\Address;
use Mitrik\Shipping\ServiceProviders\Box\BoxCollection;
use Mitrik\Shipping\ServiceProviders\Box\BoxMetric;
use Mitrik\Shipping\ServiceProviders\ServiceFedEx\ServiceFedEx;
use Mitrik\Shipping\ServiceProviders\ServiceFedEx\ServiceFedExCredentials;

$credentials = new ServiceFedExCredentials(env('FEDEX_CLIENT_ID'), env('FEDEX_CLIENT_SECRET'), env('FEDEX_ACCOUNT_NUMBER'));
$fedEx = new ServiceFedEx($credentials);

$result = $fedEx->ship(
    new ShipFrom(
        'Ivan Mitrikeski',
        'Ivan Mitrikeski',
        new Address(
            'Ivan',
            'Mitrikeski',
            '',
            '1 Wall St',
            '',
            'New York',
            '10005',
            'NY',
            'US'
        ),
        new Phone('+1', '555', '1231234'),
        ''
    ),
    new ShipTo(
        'John Smith',
        'John Smith',
        new Address(
            'John',
            'Smith',
            '',
            '1 Wall St',
            '',
            'New York',
            '10005',
            'NY',
            'US'
        ),
        new Phone('+1', '555', '1231234')
    ),
    new BoxCollection([
        new BoxImperial(20, 10, 5, 1)
    ]),
    new ServiceProviderService('FEDEX_2_DAY', '')
);

Testing

Update phpunit.xml env variables before running tests.

<php>
    <env name="DB_CONNECTION" value="mysql"/>
    <env name="DB_HOST" value="localhost"/>
    <env name="DB_PORT" value="3306"/>
    <env name="DB_DATABASE" value=""/>
    <env name="DB_USERNAME" value="root"/>
    <env name="DB_PASSWORD" value=""/>
    
    <env name="TEST_SHIPPING_ORIGIN_FIRST_NAME" value=""/>
    <env name="TEST_SHIPPING_ORIGIN_LAST_NAME" value=""/>
    <env name="TEST_SHIPPING_ORIGIN_COMPANY" value=""/>
    <env name="TEST_SHIPPING_ORIGIN_LINE1" value=""/>
    <env name="TEST_SHIPPING_ORIGIN_LINE2" value=""/>
    <env name="TEST_SHIPPING_ORIGIN_CITY" value=""/>
    <env name="TEST_SHIPPING_ORIGIN_POSTAL_CODE" value=""/>
    <env name="TEST_SHIPPING_ORIGIN_STATE" value=""/>
    <env name="TEST_SHIPPING_ORIGIN_COUNTRY" value=""/>
    
    <env name="CANADA_POST_CUSTOMER_NUMBER" value=""/>
    <env name="CANADA_POST_USERNAME" value=""/>
    <env name="CANADA_POST_PASSWORD" value=""/>
    
    <env name="UPS_CLIENT_ID" value=""/>
    <env name="UPS_CLIENT_SECRET" value=""/>
    <env name="UPS_USER_ID" value=""/>
    <env name="UPS_ACCOUNT_NUMBER" value=""/>
    
    <env name="PUROLATOR_KEY" value=""/>
    <env name="PUROLATOR_PASSWORD" value=""/>
    <env name="PUROLATOR_BILLING_ACCOUNT" value=""/>
    <env name="PUROLATOR_REGISTERED_ACCOUNT" value=""/>
    <env name="PUROLATOR_USER_TOKEN" value=""/>
    
    <env name="FEDEX_CLIENT_ID" value=""/>
    <env name="FEDEX_CLIENT_SECRET" value=""/>
    <env name="FEDEX_ACCOUNT_NUMBER" value=""/>
    
    <env name="USPS_CLIENT_ID" value=""/>
    <env name="USPS_CLIENT_SECRET" value=""/>
    
    <env name="SHIPPING_SANDBOX" value="true"/>
</php>
composer test

Alternatives to ivanmitrikeski/laravel-shipping

multicaret/laravel-acquaintances

This light package, with no dependencies, gives Eloquent models the ability to m...

343,455 850
sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by...

69,548 97
qirolab/laravel-reactions

Implement reactions (like, dislike, love, emotion etc) on Laravel Eloquent model...

97,101 196
verbb/shippy

A framework agnostic, multi-carrier shipping library for PHP.

20,485 17
rennokki/rating

Laravel Eloquent Rating allows you to assign ratings to any model.

17,500 190

Version History

Version Released PHP Laravel License
v1.0.11 ^8.2 ^11.0|^12.0|^13.0 MIT
v1.0.10 ^8.2 ^11.0|^12.0|^13.0 MIT
v1.0.9 ^8.2 ^11.0|^12.0|^13.0 MIT
v1.0.8 >=8.2 ^10.0|^11.0|^12.0 MIT
v1.0.7 >=8.2 ^10.0|^11.0|^12.0 MIT