PHPackages                             thank-song/lecang - 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. [API Development](/categories/api)
4. /
5. thank-song/lecang

ActiveLibrary[API Development](/categories/api)

thank-song/lecang
=================

Laravel package for Lecang API.

V1.0.0(6mo ago)07MITPHPPHP ^8.0

Since Oct 27Pushed 6mo agoCompare

[ Source](https://github.com/AndyMoxq/lecang)[ Packagist](https://packagist.org/packages/thank-song/lecang)[ RSS](/packages/thank-song-lecang/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

环境要求：
-----

[](#环境要求)

- PHP &gt;= 7.1,
- Laravel &gt;= 5.5

安装
--

[](#安装)

```
composer require thank-song/lecang
```

配置
--

[](#配置)

配置 `.env` 文件,添加以下配置：

```
LECANG_ACCESS_KEY=your_access_key
LECANG_SECRET_KEY=your_secret_key

```

或发布配置文件到主项目：

```
php artisan vendor:publish --tag=lecang
```

然后在 `config/lecang.php` 文件中配置相关参数。

使用
--

[](#使用)

### 使用方法一，使用工厂方法：

[](#使用方法一使用工厂方法)

```
use ThankSong\Lecang\Lecang;
$response = Lecang::getProductList(1, 10);
var_dump($response->getData());
var_dump($response->getTotal());
var_dump($response->hasMore());
```

### 使用方法二，实例化请求类：

[](#使用方法二实例化请求类)

```
use ThankSong\Lecang\Request\GetProductListRequest;

$request = new GetProductListRequest();
$request -> setPageNum(1)->setPageSize(10);
$response = $request -> send();
var_dump($response->getData());
var_dump($response->getTotal());
var_dump($response->hasMore());
```

### 使用方法三，直接使用工厂类基本请求（应用于不支持的请求类）：

[](#使用方法三直接使用工厂类基本请求应用于不支持的请求类)

```
use ThankSong\Lecang\Lecang;

$response = Lecang::basicRequest('oms/inventoryOverview/apiPage', ['pageNum' => 1, 'pageSize' => 10],'GET');
var_dump($response->getData());
var_dump($response->getTotal());
var_dump($response->hasMore());
```

更多受支持方法，请参考 `src/Request` 目录下的请求类。

注意事项
----

[](#注意事项)

- 请确保您的服务器环境支持 `openssl` 扩展，否则无法使用签名验证。
- 请确保您的 `LECANG` 账户有相关权限，否则请求可能失败。

其他
--

[](#其他)

- 欢迎提交 `PR` 或 `Issue`，共同完善此扩展。

License
-------

[](#license)

MIT License

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance66

Regular maintenance activity

Popularity4

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

197d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fbc5c485ed4609a934dba135f1dcfc1201511d73acc53f896a53ba41caf3e1ae?d=identicon)[AndyMoxq](/maintainers/AndyMoxq)

---

Tags

laravellecang

### Embed Badge

![Health badge](/badges/thank-song-lecang/health.svg)

```
[![Health](https://phpackages.com/badges/thank-song-lecang/health.svg)](https://phpackages.com/packages/thank-song-lecang)
```

###  Alternatives

[rakibdevs/openweather-laravel-api

Laravel package to connect https://openweathermap.org/ to get customized weather data for any location on the globe immediately

7648.2k](/packages/rakibdevs-openweather-laravel-api)

PHPackages © 2026

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