title: How to close Bootstrap Modal after submit form on Laravel?
body: <p>Im export <strong>excel</strong> using bootstrap modal but after submit my modal not close. i have to manually close.</p>
  
  <pre><code>&lt;button type="button" id="taxModal" class="btn btn-primary btn-group-xs"&gt;INVOICE SUMMARY&lt;/button&gt;
  
  &lt;div id="taxesModal" class="modal fade"&gt;
          &lt;div class="modal-dialog"&gt;
              &lt;div class="modal-content"&gt;
                  &lt;div class="modal-header"&gt;
                      &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;
                      &lt;/button&gt;
                      &lt;h4 class="modal-title"&gt;GENERATE TAX INVOICE&lt;/h4&gt;
  
                  &lt;/div&gt;
                  &lt;div class="modal-body"&gt;
                      &lt;form class="form-horizontal" role="form" method="POST" action="{{ url('/invoice') }}"&gt;
                          {!! csrf_field() !!}
  
                          &lt;div class="form-group{{ $errors-&gt;has('start_date') ? ' has-error' : '' }}"&gt;
                              &lt;label class="col-md-4 control-label"&gt;START DATE&lt;/label&gt;
  
                              &lt;div class="col-md-6"&gt;
                                  &lt;input type="date" class="form-control" name="start_date"&gt;
  
                                  @if ($errors-&gt;has('start_date'))
                                      &lt;span class="help-block"&gt;
                                          &lt;strong&gt;{{ $errors-&gt;first('start_date') }}&lt;/strong&gt;
                                      &lt;/span&gt;
                                  @endif
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class="form-group{{ $errors-&gt;has('end_date') ? ' has-error' : '' }}"&gt;
                              &lt;label class="col-md-4 control-label"&gt;END DATE&lt;/label&gt;
  
                              &lt;div class="col-md-6"&gt;
                                  &lt;input type="date" class="form-control" name="end_date"&gt;
  
                                  @if ($errors-&gt;has('end_date'))
                                      &lt;span class="help-block"&gt;
                                          &lt;strong&gt;{{ $errors-&gt;first('end_date') }}&lt;/strong&gt;
                                      &lt;/span&gt;
                                  @endif
                              &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class="form-group "&gt;
                              &lt;div class="col-md-3 col-md-offset-3"&gt;
                                  &lt;button type="submit" class="btn btn-primary form-control" id="btnSubmit" &gt;Submit&lt;/button&gt;
                              &lt;/div&gt;
                              &lt;div class="col-md-3"&gt;
                                  &lt;button type="button" class="btn btn-danger form-control" data-dismiss="modal"&gt;Close&lt;/button&gt;
                              &lt;/div&gt;&lt;/div&gt;
                      &lt;/form&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;!-- /.modal-content --&gt;
          &lt;/div&gt;
          &lt;!-- /.modal-dialog --&gt;
      &lt;/div&gt;
      &lt;!-- /.modal --&gt;
  </code></pre>
  
  <p>from my contoller im generating Excel document successfully but my modal not closeing after submit. i tired <code>data-dismiss="modal"</code> in my button but modal will close before submit the form. in my controller i tried <code>return rediect();</code> that is also dosn't work. im open this modal using below script </p>
  
  <pre><code>$(document).ready(function () {
          $("#taxModal").click(function () {
              $("#taxesModal").modal('show');
          });
  
      });
  </code></pre>
  
  <p><strong>My Controller function</strong> </p>
  
  <pre><code> public function invoice_create()
      {
       $start = Input::get('start_date');
       $end = Input::get('end_date');
      Excel::create('INVOICE SUMMERY', function($excel) use($sum,$tot,$start,$end)    {
  $excel-&gt;sheet($start.'_'.$end, function($sheet) use($sum,$tot,$start,$end){
  })-&gt;export('xls');
  }}
  </code></pre>
  
  <p><strong>My Route :</strong> </p>
  
  <pre><code>Route::post('invoice','HvAccountController@invoice_create');
  </code></pre>