定制 andyts93/laravel-ebay 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

andyts93/laravel-ebay

Composer 安装命令:

composer require andyts93/laravel-ebay

包简介

Laravel package to integrate eBay REST API

README 文档

README

A Simple eBay implementation for Laravel.

⚠️ This package is under development.

Installation

Install the package through Composer.

composer require andyts93/laravel-ebay

Configuration

Publish the config file:

php artisan vendor:publish --tag=ebay-config

Follow the official eBay guide to create your keys and the test account. Edit your .env file to add these mandatory fields:

EBAY_CLIENT_ID=
EBAY_CLIENT_SECRET=
EBAY_RU_NAME=

Publish the migrations and migrate

php artisan vendor:publish --tag=ebay-migrations
php artisan migrate

Model configuration

Use the EbayProduct trait in your product model. Define the sku column name in the function (if the column is named sku you can omit the function).

<?php

use \Illuminate\Database\Eloquent\Model;
use \Andyts93\LaravelEbay\Traits\EbayProduct;

class Product extends Model
{
    use EbayProduct;
    
    protected function getSkuKeyName(): string
    {
        return 'sku';
    }
    
    ...
}

Usage

1. Create inventory item

$product = Product::first();
$product->ebayCreateInventoryItem([
    'quantity' => $product->quantity,
    'title' => Str::limit($product->name, 80, ''),
    'description' => $product->description,
    'aspects' => [
        'Brand' => [$product->brand],
    ],
], [
    'packageWeightAndSize' => [
        'weight' => [
            'unit' => 'KILOGRAM',
            'value' => $product->weight,
        ]
    ],
]);

2. Create offer

$offer = $product->ebayCreateOffer([
    'category_id' => EBAY_CATEGORY_ID,
    'price' => $product->price,
]);

3. Publish the offer

$offer->publishOffer();

Other functions

Get product's offers

$product->ebayListings()->get();

Update an offer

$offer->update([
    'category_id' => EBAY_CATEGORY_ID,
    'price' => $product->price + 10.00,
]);

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固