composer require mews/captcha
PHP
在config/app.php下配置
'providers' => [
// ...
Mews\Captcha\CaptchaServiceProvider::class,
]
'aliases' => [
// ...
'Captcha' => Mews\Captcha\Facades\Captcha::class,
]
php artisan vendor:publish
选择与config对应的数字
config下创建captcha.php
return [
'default' => [
'length' => 5, //验证码长度
'width' => 120, //图片宽