首页 > 解决方案 > 我的 laravel recaptcha 不工作,如何整合?

问题描述

我添加了以登录形式工作的 google recpatcha。然后我使用 auth::routes 进行忘记密码重置。这使得recaptcha 不起作用。

标签: laravelcaptcha

解决方案


if someone is still pulling their hair because of this issue just remove the 'recaptcha' in validation rule.

use

'g-recaptcha-response' => 'required'
instead of

'g-recaptcha-response' => 'required|recaptcha'
see http://tuts.codingo.me/google-recaptcha-in-laravel-application/

或者

<div class="g-recaptcha" 
           data-sitekey="{{env('GOOGLE_RECAPTCHA_KEY')}}">
</div>

推荐阅读