当前位置:网站首页>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>
边栏推荐
- Related examples of data storage in memory
- Experts' suggestions | 8 measures to accelerate your innovative career planning and growth
- Parabolic motion in unity 2D games
- Solving error: creating window glfw error: glew initialization error: missing GL version
- 哈希表、哈希冲突
- How to solve SQL import
- Dialogue: recommended system quick start route and summary of knowledge points
- Knowledge of initial C language 2.0
- Problems encountered in debugging botu TCP connection with debugging tool
- 戴尔电脑cpu温度过高怎么办
猜你喜欢

【Proteus仿真】51单片机+DS1302+lcd1602显示

On the simple realization of Sanzi chess game and the method of judging the victory of n-zi chess

112页机器学习-数学基础回顾.pptx

How does hash eagle, the founder of equity NFT, redefine NFT and use equity to enable long-term value?

Explain the possible memory leaks caused by the handler at one time and the solutions | the developer said · dtalk

When the input tag type is number, the input of E, e, -, + is blocked

专家建议|8大措施加速你的创新职业规划和成长

Scope of ES6 variable

How to determine if a web worker has been created or closed

JVM uses tools to analyze classic cases of OOM
随机推荐
广发易淘金和同花顺哪个更好,更安全一些
Discriminative v.s.Generative
数据库中显示error1822,error1824
Knowledge of initial C language 2.0
NR-ARFCN和信道栅格、同步栅格和GSCN
【Proteus仿真】51单片机+DS1302+lcd1602显示
Graph contractual learning with augmentations
sigmoid函数sigmoid求导
BACnet gateway bl103 for building automation
权益NFT开创者Hash Eagle如何重新定义NFT,用权益赋能长续价值?
Test your earning power? What will you do in the future?
shell 数组
As a software testing engineer, how do you think to ensure software quality?
电脑必须打开的设置
专家建议|8大措施加速你的创新职业规划和成长
触觉智能分享-RK3568在金融自助终端的应用
阻止深度神经网络过拟合(Mysteries of Neural Networks Part II)
leetcode:456. 132 mode [monotone stack]
【开源鸿蒙系统展示】RK3568开发板搭载OpenHarmony 3.1 Release
语法'陷阱'