title: How to open the modal if there is a validation error?
body: <p>I have this code below, if a user is not authenticated it appears this "Login" link:</p>
  
  <pre><code> @if(!\Auth::check())
      &lt;span&gt;&lt;a id="show_login_modal" href="javascript:void(0)"&gt;Login&lt;/a&gt;
      &lt;/span&gt;
  @endif
  </code></pre>
  
  <p>If the user logins with success the modal close and the user is loged in. Its working fine.</p>
  
  <p>But if there is a validation error, for example if password is inscorrect, the modal is closed the user is not loged in and no error message appears. For the validaiton message appear is necessary to click in "login" to open again the modal and it apperas "These credentials do not match our records."</p>
  
  <p>Do you know how to if there is a validation error open the modal without be necessary to click in "login"?</p>
  
  <p>jQuery:</p>
  
  <pre><code>$('#show_login_modal').click(function(){
      $('#login_modal').modal('show');
  })
  
  $('#close_login_modal').click(function(){
      $('#login_modal').modal('hide');
  })
  </code></pre>
  
  <p>Modal:</p>
  
  <pre><code>&lt;div class="modal fade" id="login_modal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true"&gt;
    &lt;div class="modal-dialog modal-sm"&gt;
      &lt;div class="modal-content"&gt;
        &lt;div class="modal-header"&gt;
          &lt;h5 class="modal-title" id="exampleModalLabel"&gt;Login&lt;/h5&gt;
          &lt;button type="button" class="close"&gt;
            &lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;
          &lt;/button&gt;
        &lt;/div&gt;
        &lt;div class="modal-body"&gt;
          &lt;div class="container"&gt;
            &lt;div class="row"&gt;
              @include('includes.errors')
              &lt;form class="clearfix" method="POST" action="{{ route('login') }}"&gt;
                {{ csrf_field() }}
                &lt;div class="form-group col-12 px-0"&gt;
                  &lt;label for="inputEmail4"&gt;Email&lt;/label&gt;
                  &lt;input type="email" class="form-control" value="{{ old('email') }}" name="email" required autofocus placeholder="Email"&gt;
                &lt;/div&gt;
                &lt;div class="form-group col-12 px-0"&gt;
                  &lt;label for="inputEmail4"&gt;Password
                    &lt;a href="{{ route('password.request') }}" class="text-gray ml-1" style="text-decoration: underline"&gt;
                      &lt;small&gt;Recover password&lt;/small&gt;&lt;/a&gt; &lt;/label&gt;
                  &lt;input type="password" class="form-control" name="password" required placeholder="Palavra-passe"&gt;
                &lt;/div&gt;
                &lt;button type="submit" class="btn btn-primary btn d-block w-100"&gt;Login&lt;/button&gt;
              &lt;/form&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="modal-footer"&gt;
          &lt;button type="button" id="close_login_modal" class="btn btn-primary" data-dismiss="modal"&gt;Close&lt;/button&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>errors.blade.php</p>
  
  <pre><code>@if ($errors-&gt;any())
  
       &lt;ul&gt;
          @foreach ($errors-&gt;all() as $error)
              &lt;li&gt;{{ $error }}&lt;/li&gt;
          @endforeach
       &lt;/ul&gt;
  
  @endif
  </code></pre>