当前位置:网站首页>Laravel8 implementation of picture verification code
Laravel8 implementation of picture verification code
2022-06-25 14:05:00 【Chenqing Nuo language】
1、 adopt composer Install verification code package
stay Composer To carry out the following orders
composer require mews/captcha
2、 To configure
stay config/app.php in find aliases Add the following code to the array
'Captcha' => Mews\Captcha\CaptchaServiceProvider::class,
3、 Generate configuration files
stay Composer To carry out the following orders , If the pop-up option , Select to config, my config Of tag yes 11, Input 11 Back carriage return , Then it will be in config Generate configuration files in the folder ; In the configuration file length Is the number of digits of the generated verification code ;
php artisan vendor:publish
4、 The front end uses the verification code
Add... Where needed
<img src="{
{captcha_src()}}" id="captcha">
Switch verification code
<script>
$('#captcha').click(function(){
$(this).prop('src',"{
{captcha_src()}}"+Math.random(1000,9999));
})
</script>
边栏推荐
猜你喜欢

Pourquoi les programmeurs devraient - ils être plus doux?

shell 字符串变量

Logistic Regression VS Linear Regression

K-line diagram 24 classic diagrams (shadow)

Nine parts of speech and nine tenses in English

Graph contractual learning with augmentations

Realization of neural networks with numpy

一次性讲清楚 Handler 可能导致的内存泄漏和解决办法 | 开发者说·DTalk

Win7显示屏幕亮度在哪里可以调节

Rust,程序员创业的最佳选择?
随机推荐
##脚本编写ssh免密功能
Windows下MySQL的安装和删除
Insight into heap and stack stored in new string() /string() in JS
How to configure aliases for typescript + vite projects
k线图24种经典图解(影线篇)
Explanation of a textbook question
Today in history: Netease was founded; The first consumer electronics exhibition was held; The first webcast in the world
【开源鸿蒙系统展示】RK3568开发板搭载OpenHarmony 3.1 Release
Graph contractual learning with augmentations
Openstack learning notes (I)
Nine parts of speech and nine tenses in English
删库跑路、“投毒”、改协议,开源有哪几大红线千万不能踩?
Application of tactile intelligent sharing-rk3568 in financial self-service terminal
Typescript and go --- essence
QT memory mapping
Win7显示屏幕亮度在哪里可以调节
[open source Hongmeng system display] the rk3568 development board is equipped with openharmony 3.1 release
shell 字符串变量
Websocket -- reverse proxy to solve cross domain problems
国信证券股票开户是安全的吗?