amadulhaque/laravel-1688-package
最新稳定版本:1.0.0
Composer 安装命令:
composer require amadulhaque/laravel-1688-package
包简介
Alibaba 1688 API integration for Laravel
README 文档
README
A complete Laravel package for 1688 Alibaba. This package provides a simple and expressive API for interacting with the 1688.com dropshipping API.
Installation
You can install the package via composer:
composer require amadulhaque/laravel-1688-package
Next, you must publish the configuration file:
php artisan vendor:publish --provider="Amadulhaque\Laravel1688\Alibaba1688ServiceProvider" --tag="alibaba1688-config"
This will create a config/alibaba1688.php file in your project.
Finally, add the following keys to your .env file:
ALIBABA_APP_KEY=your-app-key
ALIBABA_SECRET_KEY=your-secret-key
ALIBABA_ACCESS_TOKEN=your-access-token
Usage
You can use the Alibaba1688 facade to access the API methods.
Search Products
use Amadulhaque\Laravel1688\Facades\Alibaba1688; $products = Alibaba1688::products('iphone');
You can also provide additional parameters:
$products = Alibaba1688::products( keyword: 'iphone', currentPage: 1, pageSize: 20, priceStart: '100', priceEnd: '500', categoryId: 123 );
Search Products by Multiple Keywords
$products = Alibaba1688::productsByMultipleKeywords(['hot items', 'new items']);
Get Product Details
$productDetails = Alibaba1688::productDetails('product-id');
Search by Image
$imageBase64 = base64_encode(file_get_contents('path/to/your/image.jpg')); $products = Alibaba1688::productImageSearch($imageBase64);
Get Recommended Products
$recommendedProducts = Alibaba1688::recommendProducts('product-id');
Get Categories
$categories = Alibaba1688::categories();
Check Connection
You can check the connection to the API:
$response = Alibaba1688::checkConnect();
Testing the Package
This document provides instructions on how to set up the environment and run the tests for this package.
Setup
-
Clone the repository:
git clone https://github.com/AmadulHaque/1688-laravel.git cd 1688-laravel-package -
Install dependencies: Make sure you have Composer installed. Then, run the following command to install the required dependencies, including the development dependencies:
composer install
The main development dependencies for testing are:
phpunit/phpunitorchestra/testbenchnunomaduro/collision
Running Tests
You can run the tests using the following Composer scripts defined in composer.json:
-
Run the test suite: This command executes the entire test suite.
composer test -
Run the test suite with testdox format: This command runs the tests and displays the output in a "testdox" format, which is more readable.
composer testdox
Contributing
Contributions are welcome! Please feel free to submit a pull request.
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature). - Commit your changes (
git commit -am 'Add some feature'). - Push to the branch (
git push origin feature/your-feature). - Create a new Pull Request.
- 1688 Api
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-08-23