承接 farmto/shippo-laravel 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

farmto/shippo-laravel

最新稳定版本:v1.18.10

Composer 安装命令:

composer require farmto/shippo-laravel

包简介

Laravel integration for Shippo Api

README 文档

README

A Laravel package that integrates the Shippo API into your Laravel application for easy shipping label generation, tracking, and carrier management.

Latest Version on Packagist Total Downloads

Installation

You can install the package via composer:

composer require FarmToYou/shippo-laravel

Configuration

Publish the configuration file:

php artisan vendor:publish --provider="FarmToYou\ShippoLaravel\ShippoCarrierServiceProvider"

Then update your .env file with your Shippo API credentials:

SHIPPO_API_KEY=your_api_key_here
SHIPPO_API_VERSION=2018-02-08

Usage

use FarmToYou\ShippoLaravel\Facades\ShippoCarrier;

// Create a shipping label
$shipment = ShippoCarrier::createShipment([
    'address_from' => [
        'name' => 'John Doe',
        'street1' => '123 Main St',
        'city' => 'San Francisco',
        'state' => 'CA',
        'zip' => '94105',
        'country' => 'US',
    ],
    'address_to' => [
        'name' => 'Jane Doe',
        'street1' => '456 Oak St',
        'city' => 'New York',
        'state' => 'NY',
        'zip' => '10001',
        'country' => 'US',
    ],
    'parcels' => [
        [
            'length' => 10,
            'width' => 8,
            'height' => 4,
            'distance_unit' => 'in',
            'weight' => 2,
            'mass_unit' => 'lb',
        ],
    ],
]);

// Get available shipping rates
$rates = ShippoCarrier::getShipmentRates($shipment['object_id']);

// Purchase a label
$transaction = ShippoCarrier::purchaseShippingLabel($rates[0]['object_id']);

Troubleshooting

If you encounter the error "Class 'FarmToYou\ShippoLaravels\ShippoCarriersServiceProvider' not found", there might be a namespace discrepancy. Make sure your service provider uses the correct namespace as defined in your composer.json file.

For service provider issues:

Check that your composer.json has the correct PSR-4 autoloading configuration:

"autoload": {
    "psr-4": {
        "FarmToYou\\ShippoLaravel\\": "src/"
    }
}

Then run:

composer dump-autoload

License

The MIT License (MIT). Please see License File for more information.

Credits

统计信息

  • 总下载量: 119
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-05-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固