dropday-io/laravel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

dropday-io/laravel

最新稳定版本:v1.0.0

Composer 安装命令:

composer require dropday-io/laravel

包简介

Laravel integration for Dropday dropshipping fulfillment.

README 文档

README

Latest Version on Packagist License

Official Laravel package for the Dropday API — GitHub · API docs

Send orders to dropshipping suppliers and track fulfillment status from your Laravel application.

Dropday is an order automation platform that connects your store to dropshipping suppliers. You push an order through the API; Dropday routes it to the right supplier, handles the fulfillment flow, and keeps you updated on the status.

Requirements

  • PHP 8.1+
  • Laravel 10, 11, or 12

Installation

composer require dropday-io/laravel

The service provider and Dropday facade are registered automatically via Laravel's package auto-discovery.

Publish the config file:

php artisan vendor:publish --provider="Dropday\Dropday\DropdayServiceProvider"

Configuration

Add your credentials to .env:

DROPDAY_API_KEY=your-api-key
DROPDAY_ACCOUNT_ID=your-account-id

Both values are available in your Dropday account settings. If you don't have an account yet, sign up at dropday.io.

The config also exposes DROPDAY_BASE_URL if you need to point at a staging endpoint.

Usage

You can use the facade or dependency injection.

Facade

use Dropday\Dropday\Facades\Dropday;

$order = Dropday::createOrder([
    'external_id' => 'your-internal-order-id',
    'shipping_address' => [
        'first_name' => 'Jane',
        'last_name'  => 'Doe',
        'address1'   => '123 Main St',
        'city'       => 'Amsterdam',
        'country'    => 'NL',
        'postcode'   => '1234AB',
    ],
    'products' => [
        ['sku' => 'PROD-001', 'quantity' => 1],
    ],
]);

Dependency injection

use Dropday\Dropday\Dropday;

class OrderController extends Controller
{
    public function __construct(protected Dropday $dropday) {}

    public function store(Request $request): JsonResponse
    {
        $result = $this->dropday->createOrder($request->validated());

        return response()->json($result);
    }
}

Available methods

// Submit a new order for fulfillment
Dropday::createOrder(array $data): array

// List orders, optionally filtered
Dropday::getOrders(array $filters = []): array

// Retrieve a single order by its Dropday reference ID
Dropday::getOrder(string $reference): array

Filter keys for getOrders: statuses, per_page, page, date_from, date_to, external_id, source.

Duplicate orders: if you submit an order with an external_id that already exists, Dropday returns HTTP 200 with "Order already exists" in the message key rather than an error.

For full request/response shapes, see the Dropday API docs.

Test mode

Pass "test" => true in any order payload during development. Dropday will process the order through the full validation flow but skip actual supplier routing.

Dropday::createOrder([
    'external_id' => 'test-order-001',
    'test'        => true,
    // ...
]);

Error handling

Situation Behaviour
Validation failure (422) Throws Dropday\Dropday\Exceptions\DropdayException
Any other HTTP error Throws Illuminate\Http\Client\RequestException
Duplicate external_id Returns 200; check $result['message']
use Dropday\Dropday\Exceptions\DropdayException;
use Illuminate\Http\Client\RequestException;

try {
    $order = Dropday::createOrder($data);
} catch (DropdayException $e) {
    // HTTP 422 — validation error
} catch (RequestException $e) {
    // Network or server error
}

Testing

Use Laravel's Http::fake() to mock Dropday responses without hitting the real API:

use Illuminate\Support\Facades\Http;

Http::fake([
    '*/orders' => Http::response(['id' => 'ORD-1', 'status' => 'pending'], 200),
]);

$result = Dropday::createOrder(['external_id' => 'test-1', 'test' => true]);

expect($result['status'])->toBe('pending');

Get started with Dropday

  1. Create a Dropday account
  2. Copy your API key and account ID from the account settings
  3. Add them to your .env and start sending orders

Browse the full API reference for available fields, order statuses, and webhook events.

Changelog

See CHANGELOG.md for a full history of changes.

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固