PHPackages                             widia/shipping - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. widia/shipping

ActiveLibrary

widia/shipping
==============

Shipping package

071PHP

Since Sep 1Pushed 7mo agoCompare

[ Source](https://github.com/widia1985/Shipping)[ Packagist](https://packagist.org/packages/widia/shipping)[ RSS](/packages/widia-shipping/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

Widia Shipping Package
======================

[](#widia-shipping-package)

A Laravel package for integrating multiple shipping carriers (FedEx, UPS, etc.).

Requirements
------------

[](#requirements)

- PHP &gt;= 7.3
- Laravel &gt;= 6.0

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require widia/shipping
```

Configuration
-------------

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --provider="Widia\Shipping\ShippingServiceProvider"
```

This will create a `config/shipping.php` file in your config directory.

Usage
-----

[](#usage)

```
use Widia\Shipping\Facades\Shipping;

// Set carrier account
Shipping::setCarrier('fedex')->setAccount('your_account_number');

// Create shipping label
$label = Shipping::createLabel([
    'service_type' => 'GROUND',
    'shipper' => [
        'name' => 'John Doe',
        'address' => [
            'street' => '123 Main St',
            'city' => 'New York',
            'state' => 'NY',
            'postal_code' => '10001',
            'country' => 'US'
        ]
    ],
    'recipient' => [
        'name' => 'Jane Smith',
        'address' => [
            'street' => '456 Oak St',
            'city' => 'Los Angeles',
            'state' => 'CA',
            'postal_code' => '90001',
            'country' => 'US'
        ]
    ],
    'package' => [
        'weight' => 10,
        'length' => 12,
        'width' => 8,
        'height' => 6
    ]
]);

$shipping = new Shipping();

$data = [
    'shipper' => [
        'name' => 'John Doe',
        'address' => [
            'street' => '123 Main St',
            'city' => 'New York',
            'state' => 'NY',
            'postal_code' => '10001',
            'country' => 'US'
        ]
    ],
    'recipient' => [
        'name' => 'Jane Smith',
        'address' => [
            'street' => '456 Oak St',
            'city' => 'Los Angeles',
            'state' => 'CA',
            'postal_code' => '90001',
            'country' => 'US'
        ]
    ],
    'package' => [
        'weight' => 10,
        'length' => 12,
        'width' => 8,
        'height' => 6
    ]
];

// 只比较 FedEx 和 UPS
$comparison = $shipping->compareRates($data, ['fedex', 'ups']);

// 获取所有承运商中最便宜的选项
$cheapest = $shipping->getCheapestRate($data);

// 获取特定服务类型的最便宜选项
$cheapestGround = $shipping->getCheapestRateByService($data, 'GROUND');
```

Supported Carriers
------------------

[](#supported-carriers)

- FedEx
- UPS

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

\[ 'all\_rates' =&gt; \[ 'fedex' =&gt; \[ 'GROUND' =&gt; \[ 'carrier' =&gt; 'fedex', 'service\_type' =&gt; 'GROUND', 'total\_charge' =&gt; 15.99, 'currency' =&gt; 'USD', 'delivery\_time' =&gt; '2024-03-25', 'transit\_time' =&gt; '3 days' \], // ... 其他服务类型 \], 'ups' =&gt; \[ 'GROUND' =&gt; \[ 'carrier' =&gt; 'ups', 'service\_type' =&gt; 'GROUND', 'total\_charge' =&gt; 14.99, 'currency' =&gt; 'USD', 'delivery\_time' =&gt; '2024-03-24', 'transit\_time' =&gt; '2 days' \], // ... 其他服务类型 \] \], 'cheapest\_rates' =&gt; \[ 'GROUND' =&gt; \[ 'carrier' =&gt; 'ups', 'service\_type' =&gt; 'GROUND', 'total\_charge' =&gt; 14.99, 'currency' =&gt; 'USD', 'delivery\_time' =&gt; '2024-03-24', 'transit\_time' =&gt; '2 days' \], // ... 其他服务类型的最便宜选项 \] \]

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance43

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity17

Early-stage or recently created project

 Bus Factor1

Top contributor holds 72.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3ca89f914ffb1cb2bc1dc7f30884be5c3e82ff1a19ad86746ea86cea427bc4de?d=identicon)[widia1985](/maintainers/widia1985)

---

Top Contributors

[![fatbenny](https://avatars.githubusercontent.com/u/17696749?v=4)](https://github.com/fatbenny "fatbenny (21 commits)")[![widia1985](https://avatars.githubusercontent.com/u/42551207?v=4)](https://github.com/widia1985 "widia1985 (8 commits)")

### Embed Badge

![Health badge](/badges/widia-shipping/health.svg)

```
[![Health](https://phpackages.com/badges/widia-shipping/health.svg)](https://phpackages.com/packages/widia-shipping)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
