先在终端安装扩展包
composer require mews/captcha;
可以在config/app.php文件中修改验证码配置
'providers' => [
MewsCaptchaCaptchaServiceProvider::class,
],
'aliases' => [
'Captcha' => MewsCaptchaFacadesCaptcha::class,
],
'characters' =>'',
'default' =>[],
'flat' =>",
'mini' =>[],
在视图文件中
使用captcha_img()或者captcha_src()即可显示验证码
控制器中
validator(['captcha'=>"required|captcha"]);
//验证验证码