我在 Laravel 5.2 项目中安装了 greggilbert/recaptcha。我按照此处描述的方向进行操作:https://github.com/greggilbert/recaptcha
但是当我打开使用验证码的表单时,我发现了上述消息。 我读了源代码但什么都不懂。 有人可以帮我在这方面找到解决方案吗? 预先感谢。
这是我的表单 HTML 代码
@section('form')
{{ Form::open(array('url' => 'contact')) }}
<div class="panel-body">
<div class="form-group">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-comment blue"></i></span>
<textarea name="InputMessage" rows="6" class="form-control" required placeholder="Message"></textarea>
</div>
</div>
{!! Recaptcha::render() !!}
<div class="">
<button type="submit" class="btn btn-info pull-right">Send <span class="glyphicon glyphicon-send"></span></button>
<button type="reset" value="Reset" name="reset" class="btn">Reset <span class="glyphicon glyphicon-refresh"></span></button>
</div>
</div>
{{Form::close()}}
@endsection
问题解决了。
问题是:
php artisan vendor:publish --provider="Greggilbert\Recaptcha\RecaptchaServiceProvider"`
命令什么也没做。 因此
recaptcha.php
文件未复制到根配置文件夹。
我从
复制了
recaptcha.php
文件
vendor > greggilbert > recaptcha > src > config > recaptcha.php`
到config文件夹,问题就消失了。
供应商发布后,您需要使用命令清除配置缓存
php artisan 配置:缓存