Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation message is not shown #139

Open
danifantom opened this issue Jun 20, 2017 · 2 comments
Open

Validation message is not shown #139

danifantom opened this issue Jun 20, 2017 · 2 comments

Comments

@danifantom
Copy link

If I try to send the form without completing the captcha the form just reloads with no error messages.
In the LoginController.php I have this

 protected function validateLogin(Request $request)
    {
        $this->validate($request, [
            $this->username() => 'required', 
            'password' => 'required',
            'g-recaptcha-response' => 'required|recaptcha',
        ]);
    }

I've even tried to change the validation message but nothing shows up

@Askancy
Copy link

Askancy commented Jul 4, 2017

Add this code to your view

@if(count($errors->all()) > 0)
  <div class="alert alert-danger" role="alert"> <p><b>Attenzione!</b></p>
    <ul>
      @foreach($errors->all() as $error)
        <li>{{ $error }}</li>
      @endforeach
    </ul>
  </div>
@endif

@ihsanberahim
Copy link

I used this

                        <div class="form-group">
                            <div class="col-md-6 col-md-offset-4">{!! Recaptcha::render() !!}
                             @if ($errors->has('g-recaptcha-response'))
                                 <span class="help-block">
                                     <strong>{{ $errors->first('g-recaptcha-response') }}</strong>
                                 </span>
                             @endif
                            </div>
                        </div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants