验证码的安装

我们通过 Composer 安装 Captcha 扩展包

composer require mews/captcha

# 可以指定想要安装的版本
composer require mews/captcha:版本号

Laravel 验证码

使用配置

使用Captcha服务提供者之前还需要在config/app.php中注册服务提供者:

# 在服务提供者中添加此项

'providers' => [
	Mews\Captcha\CaptchaServiceProvider::class,
]

 

# 同时注册下相应门面:
'aliases' => [
  'Captcha' => Mews\Captcha\Facades\Captcha::class,
]

# 发布配置
php artisan vendor:publish

Laravel 验证码

Laravel 验证码

模板中调用

常用方法
# 返回url
{!! captcha_src() !!}

# 返回 img 的html
{!! captcha_img () !!}

# 生成配置
php artisan vendor:publish

Laravel 验证码

Laravel 验证码

模板中

Laravel 验证码

效果

Laravel 验证码

点击更换验证码图片

Laravel 验证码

验证码的输入验证

解决验证提示中文

方案1 了解

Laravel 验证码

Laravel 验证码

Laravel 验证码

方案2 推荐

Laravel 验证码

效果

Laravel 验证码

http://www.h-ui.net/Hui-4.8-alert.shtml h-ui框架手册

相关文章:

  • 2021-06-30
  • 2021-09-05
  • 2021-10-05
  • 2021-06-22
  • 2022-12-23
  • 2021-08-28
  • 2021-06-05
猜你喜欢
  • 2021-08-06
  • 2021-08-04
  • 2021-12-22
  • 2021-11-03
  • 2022-01-20
相关资源
相似解决方案