# think-captcha **Repository Path**: fastadminnet/think-captcha ## Basic Information - **Project Name**: think-captcha - **Description**: 验证码类库 think-captcha 适用于 FastAdmin 开源后台框架,同时兼容 php8,目前由 FastAdmin 开源团队维护。 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 3 - **Created**: 2023-07-05 - **Last Updated**: 2025-04-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # think-captcha thinkphp5 验证码类库 ## 安装 > composer require topthink/think-captcha ##使用 ###模板里输出验证码 ~~~
{:captcha_img()}
~~~ 或者 ~~~
captcha
~~~ > 上面两种的最终效果是一样的 ### 控制器里验证 使用TP5的内置验证功能即可 ~~~ $this->validate($data,[ 'captcha|验证码'=>'require|captcha' ]); ~~~ 或者手动验证 ~~~ if(!captcha_check($captcha)){ //验证失败 }; ~~~