用AI赚第一桶💰低成本搭建一套AI赚钱工具,源码可二开。 广告
#### 1安装图形验证码 ~~~ composer require mews/captcha ~~~ #### 2配置 ~~~ 'providers' => [ // ... Mews\Captcha\CaptchaServiceProvider::class, ] ~~~ ~~~ 'aliases' => [ // ... 'Captcha' => Mews\Captcha\Facades\Captcha::class, ] ~~~ #### 3发布 ``` $ php artisan vendor:publish ``` #### 4配置app captcha.php ``` 'default' => [ 'length' => 6, 'width' => 120, 'height' => 36, 'quality' => 90, 'math' => false, ], ``` #### 5使用 ``` <div class="row cl"> <div class="formControls col-xs-8 col-xs-offset-3"> <input class="input-text size-L" name="capcode" type="text" placeholder="验证码" onblur="if(this.value==''){this.value='验证码:'}" onclick="if(this.value=='验证码:'){this.value='';}" value="验证码:" style="width:150px;"> <img src="{{captcha_src()}}" onclick="this.src='{{captcha_src()}}'+Math.random()"> </div> </div> ``` #### 6验证验证码 ``` $rules=[ 'capcode'=>'required|captcha', ]; //提示 $notices=[ 'capcode.required'=>'验证码必须填写', 'capcode.captcha'=>'验证码不正确', ]; ```