PHPackages                             whcoding/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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. whcoding/signature

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

whcoding/signature
==================

api signature

v1.0.0(4y ago)1010MITPHPPHP ^7.3|^8.0

Since Jun 25Pushed 4y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

### laravel-signature

[](#laravel-signature)

laravel-signature 是一个接口签名验证包, 其中包括了对token生成, token过期时间, 请求的有效期, sign生成

#### 运行环境

[](#运行环境)

- php &gt;=7.3
- composer
- laravel &gt;= 8.40
- .env 开启 debug 会返回正确sign, 生产环境记得关闭.

#### 使用方法

[](#使用方法)

`composer require whcoding/signature`

设置 auth.php

```
    'defaults' => [
        'guard' => 'api', // laravel 默认 session 更改为 api
        'passwords' => 'users',
    ],

    'guards' => [
        .....

        'api' => [
            'driver' => 'signature', // 更改为 signature
            'provider' => 'users',
            'hash' => false,
        ],
    ],

```

#### 配置文件

[](#配置文件)

`php artisan vendor:publish --provider="Signature\SignatureProvider"`

#### 执行 migration

[](#执行-migration)

`php artisan migrate`

#### 前端请求需要携带的参数

[](#前端请求需要携带的参数)

```
{
    "ts" : "时间戳(请求时间)",
    "user_id" : "用户id",
    "sign": "前端根据该包的sign算法生成的(参考 Signature.php 中的 makeSign 方法)"
}

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

1788d ago

### Community

Maintainers

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

---

Top Contributors

[![whcoding](https://avatars.githubusercontent.com/u/25763789?v=4)](https://github.com/whcoding "whcoding (10 commits)")

---

Tags

apisignatureauth

### Embed Badge

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

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

###  Alternatives

[league/oauth2-server

A lightweight and powerful OAuth 2.0 authorization and resource server library with support for all the core specification grants. This library will allow you to secure your API with OAuth and allow your applications users to approve apps that want to access their data from your API.

6.6k136.0M248](/packages/league-oauth2-server)[auth0/auth0-php

PHP SDK for Auth0 Authentication and Management APIs.

40820.2M68](/packages/auth0-auth0-php)[auth0/symfony

Symfony SDK for Auth0 Authentication and Management APIs.

128738.1k](/packages/auth0-symfony)[kakadu-dev/yii2-jwt-auth

Extension provide JWT auth for Yii2

105.8k](/packages/kakadu-dev-yii2-jwt-auth)

PHPackages © 2026

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