PHPackages                             seffeng/laravel-afs - 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. seffeng/laravel-afs

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

seffeng/laravel-afs
===================

PHP laravel extension afs

v0.1.2(2y ago)1977MITPHPPHP &gt;=7.1.3

Since Jul 30Pushed 2y ago1 watchersCompare

[ Source](https://github.com/seffeng/laravel-afs)[ Packagist](https://packagist.org/packages/seffeng/laravel-afs)[ Docs](https://github.com/seffeng/laravel-afs)[ RSS](/packages/seffeng-laravel-afs/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

Laravel AFS
-----------

[](#laravel-afs)

### 安装

[](#安装)

```
# 安装
$ composer require seffeng/laravel-afs
```

##### Laravel

[](#laravel)

```
# 1、生成配置文件
$ php artisan vendor:publish --tag="afs"

# 2、修改配置文件 /config/afs.php 或在 /.env 文件中添加配置
AFS_DEBUG= #[true-不验证直接返回成功，其他-通过阿里云验证结果]
AFS_ACCESS_KEY_ID=
AFS_ACCESS_KEY_SECRET=
AFS_APPKEY=
```

##### lumen

[](#lumen)

```
# 1、将以下代码段添加到 /bootstrap/app.php 文件中的 Providers 部分
$app->register(Seffeng\LaravelAfs\AfsServiceProvider::class);

# 2、参考扩展包内 config/afs.php 在 /.env 文件中添加配置
AFS_DEBUG= #[true-不验证直接返回成功，其他-通过阿里云验证结果]
AFS_ACCESS_KEY_ID=
AFS_ACCESS_KEY_SECRET=
AFS_APPKEY=
```

### 目录说明

[](#目录说明)

```
├─config
│   afs.php
├─src
│  │  Afs.php
│  │  AfsServiceProvider.php
│  ├─Facades
│  │    Afs.php
└─tests
    AfsTest.php

```

### 示例

[](#示例)

```
/**
 * 参考 tests/AfsTest.php
 */

use Seffeng\LaravelAfs\Facades\Afs;
use Seffeng\Afs\Exceptions\AfsException;

class SiteController extends Controller
{
    public function index()
    {
        try {
            $ip = '192.168.1.100';      // 客户端IP
            $scene = 'ic_login';        // 使用场景标识，必填参数，可从前端获取 [ic_login, nc_activity_h5, ...]
            $token = '1627557...';      // 请求唯一标识，必填参数，从前端获取
            $sig = '05XqrtZ0Ea...';     // 签名串，必填参数，从前端获取
            $sessionId = '01sWbn...';   // 会话ID，必填参数，从前端获取

            // Afs::loadClient('client');   //当有多个客户端时，使用其他客户端
            Afs::setRemoteIp($ip);
            Afs::setScene($scene);
            Afs::setToken($token);
            Afs::setSig($sig);
            Afs::setSessionId($sessionId);
            var_dump(Afs::verify()); // 仅为true，其他情况抛出异常(AfsException)
        } catch (AfsException $e) {
            echo $e->getMessage();
        } catch (\Exception $e) {
            echo $e->getMessage();
        }
    }
}

```

项目依赖
----

[](#项目依赖)

依赖仓库地址备注seffeng/afs无### 备注

[](#备注)

1、测试脚本 tests/AfsTest.php 仅作为示例供参考；

2、暂只支持滑动验证和智能验证；不支持无痕验证。

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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 ~367 days

Total

3

Last Release

1012d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/30b3d8cc986a1ad37a55169b11812fea1cae31430dd8dbe1b3436dc58cc885bd?d=identicon)[seffeng](/maintainers/seffeng)

---

Top Contributors

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

---

Tags

phplaravellumenseffengafs

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/seffeng-laravel-afs/health.svg)

```
[![Health](https://phpackages.com/badges/seffeng-laravel-afs/health.svg)](https://phpackages.com/packages/seffeng-laravel-afs)
```

###  Alternatives

[kra8/laravel-snowflake

Snowflake for Laravel and Lumen.

188402.3k6](/packages/kra8-laravel-snowflake)

PHPackages © 2026

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