afoysal
6 months ago
413
1
Laravel

Google Captcha Validation message.

Posted 6 months ago by afoysal

I am working with Google Captcha. My validation code in controller is like below

$this->validate($request,[
        'name' => 'required',
        'email' => 'required|email',
        'message' => 'required',
        'g-recaptcha-response' => 'required|captcha'
    ]);

My view code for Captcha showing and validation message showing is like below

               <div class="row">
                    <div class="col" style="margin-top:20px">
                        {!! Captcha::display() !!}
                        {{ html()->hidden('captcha_status', 'true') }}
                    </div><!--col-->
                </div><!--row-->

                @if ($errors->has('g-recaptcha-response'))
                    <span class="help-block text-danger">{{ $errors->first('g-recaptcha-response') }}</span>
                @endif

I am getting message like below

https://i.stack.imgur.com/esNeW.png

How can I get a nicely formatted message ?

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