PHPackages                             uicosp/service-signature - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. uicosp/service-signature

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

uicosp/service-signature
========================

A simple signature package of Laravel 5.3 for calling different services in a big system.

1.0.3(9y ago)0196MITPHP

Since Jan 10Pushed 9y ago1 watchersCompare

[ Source](https://github.com/uicosp/service-signature)[ Packagist](https://packagist.org/packages/uicosp/service-signature)[ RSS](/packages/uicosp-service-signature/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (6)Used By (0)

服务签名 for Laravel 5.3
====================

[](#服务签名-for-laravel-53)

安装
--

[](#安装)

`composer require uicosp/service-signature`

然后在 `config/app.php` 的 `providers` 数组中添加

```
Uicosp\ServiceSignature\ServiceSignatureProvider::class

```

此扩展包含一个签名静态类用于签名和一个验证签名的中间件

签名
--

[](#签名)

`Signature::genArray($service, array $query=[]);`

- *$service* 需要调用的服务，根据此参数从配置文件查找对应的 `service_key` 和 `service_secret`
- *$query* 传递的 url 参数

返回签名后的 query 数组。示例：

```
return Signature::genArray('cas', $query = [
            'foo' => 'bar',
        ]);

```

将返回：

```
array:5 [
  "foo" => "bar"
  "service_key" => "caskey"
  "timestamp" => 1484029429
  "nonce" => "0SBliH0vT4"
  "signature" => "de203eac8b2cec03ac404ec3ed6d5bcd"
]

```

如果你希望直接返回 http\_build\_query 后的字符串，可调用 `Signature::genString($service, array $query=[])`，则如上示例将返回：

```
"foo=bar&service_key=caskey&timestamp=1484029666&nonce=YkQFuVQFMU&signature=773c3d14c082b7a0ab14dcb2f9c471bf"

```

验证签名（中间件）
---------

[](#验证签名中间件)

在 `app/Http/Kernel.php` 文件中注册 `Uicosp\ServiceSignature\VerifySignature::class`, 并对需要验证签名的路由添加本中间件。

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Every ~9 days

Total

4

Last Release

3431d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/14162142?v=4)[Sean Xia](/maintainers/uicosp)[@uicosp](https://github.com/uicosp)

---

Top Contributors

[![uicosp](https://avatars.githubusercontent.com/u/14162142?v=4)](https://github.com/uicosp "uicosp (5 commits)")

### Embed Badge

![Health badge](/badges/uicosp-service-signature/health.svg)

```
[![Health](https://phpackages.com/badges/uicosp-service-signature/health.svg)](https://phpackages.com/packages/uicosp-service-signature)
```

###  Alternatives

[kartik-v/yii2-widget-switchinput

A Yii2 wrapper widget for the Bootstrap Switch plugin to use checkboxes &amp; radios as toggle switchinputes (sub repo split from yii2-widgets)

384.6M13](/packages/kartik-v-yii2-widget-switchinput)

PHPackages © 2026

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