PHPackages                             orh/laravel-geetest-button - 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. orh/laravel-geetest-button

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

orh/laravel-geetest-button
==========================

Laravel geetest button v3.0.0, Laravel 极验证行为验证 v3.0.0

v1.0.4(8y ago)014MITPHPPHP &gt;=7.0

Since Feb 11Pushed 8y agoCompare

[ Source](https://github.com/ouronghuang/laravel-geetest-button)[ Packagist](https://packagist.org/packages/orh/laravel-geetest-button)[ RSS](/packages/orh-laravel-geetest-button/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

Laravel Geetest Button
----------------------

[](#laravel-geetest-button)

此扩展包是针对 [极验证](http://www.geetest.com/) 的行为验证 v3.0.0 开发，适用于 Laravel 5.5.\* 版本。

索引
--

[](#索引)

- [示例](#%E7%A4%BA%E4%BE%8B)
- [快速开始](#%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B)
- [发布文件说明](#%E5%8F%91%E5%B8%83%E6%96%87%E4%BB%B6%E8%AF%B4%E6%98%8E)
- [依赖](#%E4%BE%9D%E8%B5%96)
- [许可证](#%E8%AE%B8%E5%8F%AF%E8%AF%81)

示例
--

[](#示例)

[![示例图片](./images/demo.gif)](./images/demo.gif)

快速开始
----

[](#快速开始)

#### 1. 安装 laravel-geetest-button

[](#1-安装-laravel-geetest-button)

```
composer require orh/laravel-geetest-button
```

#### 2. 发布配置文件与前端资源文件

[](#2-发布配置文件与前端资源文件)

```
php artisan vendor:publish --provider="Ouronghuang\GeetestButton\ServiceProvider"
```

#### 3. 请在 `.env` 和 `.env.example` 文件添加以下配置

[](#3-请在-env-和-envexample-文件添加以下配置)

```
GEETEST_ID=
GEETEST_KEY=
```

注意：id 与 key 请在 [极验后台](https://account.geetest.com) 获取。

#### 4. 在要需要验证的页面引入以下文件

[](#4-在要需要验证的页面引入以下文件)

```

```

注意：

- 需要引入 `jQuery`；
- `gt.js` 必须在 `geetest.js` 之前引入。

#### 5. 在相应的表单加入以下代码

[](#5-在相应的表单加入以下代码)

```

    行为验证

        正在加载验证码

        请先完成验证

```

注意：

- 上述示例排版采用 [bootstrap@4.0.0](https://www.npmjs.com/package/bootstrap)；
- 上述示例图标采用 [font-awesome@4.7.0](https://www.npmjs.com/package/font-awesome)。

也可以使用如下基本结构

```

    行为验证

    正在加载验证码...
    请先完成验证

```

注意：

- 请保持如上结构；
- 样式可以根据需要调整;
- 加入 `` 是便于二次验证。

#### 6. 在服务端表单验证中加入以下规则

[](#6-在服务端表单验证中加入以下规则)

```
$this->validate($request, [
    ...
    'captcha' => 'captcha',
]);
```

至此，安装完成。

发布文件说明
------

[](#发布文件说明)

#### 1. 配置文件 `config/geetest.php`

[](#1-配置文件-configgeetestphp)

配置描述数据类型配置值`id`对应验证的 `id``string`请在 [极验后台](https://account.geetest.com) 获取`key`对应验证的 `key``string`请在 [极验后台](https://account.geetest.com) 获取`prefix`路由前缀`string`默认：`''`，如果与其它包冲突则可以修改此项`as`路由别名前缀`string`默认：`'geetest'`，一般不需要改动`middleware`路由中间件`array`默认：`['web']`，一般不需要改动`captcha`表单验证规则名称`string`默认：`'captcha'`，如果与其它包冲突则可以修改此项说明：

- 如果修改了 `prefix` 的值为 `test`，则需要修改 `public/vendor/geetest/js/geetest.js` 的

```
$.ajax({
    url: '/captcha?t=' + (new Date()).getTime()
});
```

为

```
$.ajax({
    url: '/test/captcha?t=' + (new Date()).getTime()
});
```

- 如果修改了 `captcha` 的值为 `test`，则需要修改相应的表单验证规则

```
$this->validate($request, [
    ...
    'captcha' => 'captcha',
]);
```

为

```
$this->validate($request, [
    ...
    'captcha' => 'test',
]);
```

#### 2. 前端资源文件

[](#2-前端资源文件)

文件名描述文件位置`gt.css`验证码样式文件，可根据需要修改`public/vendor/geetest/css/gt.css``gt.js`验证码库文件，一般不需要修改`public/vendor/geetest/js/gt.js``geetest.js`验证码执行文件，可根据需要修改`public/vendor/geetest/js/geetest.js`依赖
--

[](#依赖)

- Laravel 5.5.\*
- jQuery 1.9.1+

许可证
---

[](#许可证)

遵循 [MIT](./LICENSE) 开源许可

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity62

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

Total

5

Last Release

2946d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11351762?v=4)[orh](/maintainers/orh)[@OrH](https://github.com/OrH)

---

Top Contributors

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

---

Tags

laravelgeetest

### Embed Badge

![Health badge](/badges/orh-laravel-geetest-button/health.svg)

```
[![Health](https://phpackages.com/badges/orh-laravel-geetest-button/health.svg)](https://phpackages.com/packages/orh-laravel-geetest-button)
```

###  Alternatives

[lab404/laravel-auth-checker

Laravel Auth Checker allows you to log users authentication, devices authenticated from and lock intrusions.

223164.9k2](/packages/lab404-laravel-auth-checker)[cjmellor/browser-sessions

A Laravel package to enable users to manage and monitor their active browser sessions. Allows users to view devices where they are logged in and provides options to terminate unrecognized or all sessions, enhancing account security

26752.2k](/packages/cjmellor-browser-sessions)[salahhusa9/laravel-geetest-captcha

Laravel GeeTest Captcha for Laravel 9-10-11

162.8k](/packages/salahhusa9-laravel-geetest-captcha)

PHPackages © 2026

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