Van1310
138
4
Laravel

validation.captcha error when submit data

Posted 1 month ago by Van1310

when i try to click recaptcha then and submit data then error validation.captcha

here is my blade file

<div class="form-group{{ $errors->has('g-recaptcha-response') ? ' has-error' : '' }}">
        <label class="col-md-4 control-label">Captcha</label>
                <div class="col-md-6">
                            {{-- {!! app('captcha')->display() !!} --}}
                            {!! NoCaptcha::display() !!}
                            @if($errors->has('g-recaptcha-response'))
                           <span class="text-danger" style="color:red">{{$errors->first('g-recaptcha-response')}}   </span>
                            @endif
                   </div>
    </div>

here is my controller file

protected function validator(array $data)
    {
        return Validator::make($data, [
            'name' => 'required|string|max:255',
            'email' => 'required|string|email|max:255|unique:users',
            'password' => 'required|string|min:6|confirmed',
            'g-recaptcha-response' => 'required|captcha',
        ]);
    }

Please sign in or create an account to participate in this conversation.