当前位置:网站首页>laravel8实现图片验证码
laravel8实现图片验证码
2022-06-23 03:53: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>边栏推荐
- Object structure diagram, which can quickly illustrate the internal structure of an object
- Unity中,如何在【编辑器】和【运行时】状态下读写一个ScriptableObject对象
- Talk about the composite pattern in C #
- E45: ‘readonly‘ option is set (add ! to override)
- Non return to zero code NRZ
- 微信小程序:拼图工具箱
- Actual combat | multiple intranet penetration through Viper
- 使用teqcplot对teqc 质量分析结果进行可视化展示
- Laravel customizes the paging style through the service provider
- Three operation directions of integral mall
猜你喜欢

apache atlas 快速入门

Precautions for running high-frequency and high-speed signal lines near PCB board - basic principles for high-frequency and high-speed signal design

【图论】—— 二分图

Meituan's good article: understand swift, Objective-C and the mixing mechanism from the perspective of precompiling

Mini Homer - can you get a remote map data transmission link for hundreds of yuan?

Pads and flash symbols in cadence

Non return to zero code NRZ

Talk about the composite pattern in C #

AlertManager告警的单独使用及prometheus配置告警规则使用

Separate use of alertmanager alarms and use of Prometheus configuration alarm rules
随机推荐
② Cocoapods principle and podspec file uploading operation
【OFDM通信】基于matlab OFDM多用户资源分配仿真【含Matlab源码 1902期】
How to better organize the minimum web api code structure
Icer Skill 02makefile script Running VCS Simulation
Mini Homer - can you get a remote map data transmission link for hundreds of yuan?
centos7安装postgresql8.2.15及存储过程创建
396. mine site construction
Abnova abcb10 (human) recombinant protein specification
Experience of Tencent cloud installed by Kali
Dsp7 environment
Notepad++ find replace group replace retain
The solution to prompt "this list creation could be rewritten as a list literal" when adding elements to the list using the append() method in pychart
笔者认为所谓的产业互联网,就是一个产业与互联网深度融合的过程
硬核,成为高素质测试人员:学会和产品沟通需求
A mvc5+easyui enterprise rapid development framework source code BS framework source code
接收传来得文件并下载(简单用法)a标签
物体结构图,快速图解物体内部结构
Decompile
微信小程序:微信也可以发闪照了闪照制作生成微信小程序源码下载,自定义闪照时间
Object structure diagram, which can quickly illustrate the internal structure of an object