Download the PHP package godruoyi/laravel-tencent007-captcha without Composer

On this page you can find all versions of the php package godruoyi/laravel-tencent007-captcha. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-tencent007-captcha

laravel tencent captcha

StyleCI Scrutinizer Code Quality tencent captcha tencent captcha tencent captcha

安装

使用

查看 Demo

  1. 发布腾讯云防水墙配置文件。

  2. 修改应用根目录下的 config/007.php 中对应的参数。

接入

在使用 SDK 前,最好到 腾讯云防水墙 了解验证码接入的基本流程。

客户端接入

  1. 在 Head 标签中加入以下代码,引入验证 JS 文件(建议直接在 html 中引入):

  2. 在你想要激活验证码的 DOM 元素(eg. button、div、span)内加入以下 id 及属性:

  3. 为验证码创建回调函数,注意函数名要与 data-cbfn 相同:

完成以上操作后,点击激活验证码的元素,即可弹出验证码。

以上客户端接入文档来自腾讯防水墙,更多相关配置请前往 腾讯云防水墙

服务端使用

你可以通过客户端提供的 ticketVerify 方法来快速验证用户。

它将返回一个类型为 Godruoyi\Tencent007\Response 响应,并提供了一些有用的方法。

我们还提供了一个请求频率限制的中间件 ThrottleRequests,它继承了 Laravel 默认的 ThrottleRequests 中间件, 可以用它来快速实现 一分钟请求超过 60 次出现滑块验证 的效果 —— Demo

为了使用该中间件,你需要在 app/Http/Kernel.php 中添加配置。

然后在你的路由文件中使用该中间件即可(throttle.007:60,1 —— 表示 1 分钟请求超过 60 次,出现滑块验证)。

其实查看源码你就知道,当请求太多需要滑块验证时,我们会抛出一个 Exception。

该 Exception 继承自 HttpException,Laravel 默认会返回一个状态码为 429 的响应。

如果你想自定义返回类型,你可在 App\Exceptions\Handler.php 中捕获并处理。

前端需要根据接口返回的状态码做出相应处理。

License

MIT


All versions of laravel-tencent007-captcha with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version 5.* || ^6.0 || ^7.0 || ^8.0
guzzlehttp/guzzle Version ^6.2 || ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package godruoyi/laravel-tencent007-captcha contains the following files

Loading the files please wait ....