当前位置:网站首页>laravel8实现图片验证码
laravel8实现图片验证码
2022-06-25 13:40:00 【陈卿诺语】
1、通过composer安装验证码包
在Composer里执行以下命令
composer require mews/captcha
2、配置
在 config/app.php 中 找到 aliases数组加入以下代码
'Captcha' => Mews\Captcha\CaptchaServiceProvider::class,
3、生成配置文件
在Composer里执行以下命令,如果弹出选项,选择到config,我的config的tag是11,输入11后回车,然后就会在config文件夹里生成配置文件;配置文件里的length是生成验证码多少位;
php artisan vendor:publish
4、前端使用验证码
在需要的地方加入
<img src="{
{captcha_src()}}" id="captcha">
切换验证码
<script>
$('#captcha').click(function(){
$(this).prop('src',"{
{captcha_src()}}"+Math.random(1000,9999));
})
</script>
边栏推荐
- Experts' suggestions | 8 measures to accelerate your innovative career planning and growth
- untiy强制刷新UI
- Cesium model Daquan glb/glft format
- Suanli & NFT trading platform f3 The exclusive NFT project of XYZ, hash eagle, will be grandly launched
- Class usage and inheritance in ES6
- Getting started with numpy Library
- Vscode--- format setting configuration
- Is it safe for tongdaxin to open a stock account
- Explanation of a textbook question
- 【Proteus仿真】51单片机+DS1302+lcd1602显示
猜你喜欢

Some knowledge of the initial C language

Kubernetes cluster construction of multiple ECS

Installation and removal of MySQL under Windows

Cesium learning notes

As a software testing engineer, how do you think to ensure software quality?

Classifier and cross entropy loss function

Shell operator

Related examples of data storage in memory

BACnet gateway bl103 for building automation

JVM 用工具分析OOM经典案例
随机推荐
请问通达信股票开户是安全的吗?
NR-ARFCN和信道栅格、同步栅格和GSCN
Dialogue: recommended system quick start route and summary of knowledge points
[proteus simulation] 51 MCU +ds1302+lcd1602 display
删库跑路、“投毒”、改协议,开源有哪几大红线千万不能踩?
Test your earning power? What will you do in the future?
论文阅读:Graph Contrastive Learning with Augmentations
程序员为什么要软一点?
Experts' suggestions | 8 measures to accelerate your innovative career planning and growth
完整详细的汇编实验报告
Getting started with numpy Library
Websocket -- reverse proxy to solve cross domain problems
Numpy库使用入门
Unity 2D游戏中的抛物运动
112页机器学习-数学基础回顾.pptx
Mise en place d'un Cluster kubernets avec plusieurs serveurs Cloud
程序員為什麼要軟一點?
shell 字符串变量
Classifier and cross entropy loss function
多台云服务器的 Kubernetes 集群搭建