总结7.19 laravel验证码

先在终端安装扩展包

composer require mews/captcha;

可以在config/app.php文件中修改验证码配置

  'providers' => [

    Mews\Captcha\CaptchaServiceProvider::class,

  ],

  'aliases' => [

    'Captcha' => Mews\Captcha\Facades\Captcha::class,

  ],

'characters' =>'',

'default' =>[],

'flat' =>",

'mini' =>[],

在视图文件中

使用captcha_img()或者captcha_src()即可显示验证码

控制器中

validator(['captcha'=>"required|captcha"]);

//验证验证码

posted @ 2020-08-13 14:06  HighKK  阅读(147)  评论(0编辑  收藏  举报