title: Delete data using modal box in laravel
body: <p>I have some problem to delete data with confirmation (in this case using modal box) in laravel. </p>
  
  <p>This is my delete button</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>{{ Form::open(array(
                                  'route' =&gt; array('delete_spk', $spk_data-&gt;id),
                                  'method' =&gt; 'put',
                                  'style' =&gt; 'display:inline'
                                  ))
                              }}
                              &lt;button class="btn btn-danger btn-line btn-rect" type="submit" data-toggle="modal" data-target="#delSpk" data-title="Delete SPK" data-message='Are you sure you want to delete this data ?'&gt;
                              &lt;i class="icon-trash icon-white"&gt;&lt;/i&gt; Delete&lt;/button&gt;
                              {{ Form::close() }}</code></pre>
  </div>
  </div>
  </p>
  
  <p>This is the modal box </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!--MODAL DELETE SPK--&gt;
  &lt;div class="col-lg-12"&gt;
                          &lt;div class="modal fade" id="delSpk" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&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-hidden="true"&gt;&amp;times;&lt;/button&gt;
                                              &lt;h4 class="modal-title" id="H4"&gt; Delete SPK&lt;/h4&gt;
                                          &lt;/div&gt;
                                          &lt;div class="modal-body"&gt;
                                          &lt;p class="help-block"&gt;Are you sure you want to delete this data ?&lt;/p&gt;
                                          &lt;/div&gt;
                                          &lt;div class="modal-footer"&gt;
                                         &lt;button type="button" class="btn btn-danger btn-line btn-rect" id="confirm"&gt;Yes&lt;/button&gt;
                                          &lt;button type="button" class="btn btn-primary btn-line btn-rect" data-dismiss="modal"&gt;No&lt;/button&gt;
                                          &lt;/div&gt;
  
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
  &lt;!--END OF MODAL DELETE SPK--&gt;
  
  &lt;!-- Dialog show event handler --&gt;
  &lt;script type="text/javascript"&gt;
    $('#delSpk').on('show.bs.modal', function (e) {
        $message = $(e.relatedTarget).attr('data-message');
        $(this).find('.modal-body p').text($message);
        $title = $(e.relatedTarget).attr('data-title');
        $(this).find('.modal-title').text($title);
  
        // Pass form reference to modal for submission on yes/ok
        var form = $(e.relatedTarget).closest('form');
        $(this).find('.modal-footer #confirm').data('form', form);
    });
  
    &lt;!-- Form confirm (yes/ok) handler, submits form --&gt;
    $('#delSpk').find('.modal-footer #confirm').on('click', function(){
        $(this).data('form').submit();
    });
  &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>This is the route </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>Route::get('spk/destroy/{id}', array('as'=&gt;'delete_spk','uses'=&gt;'SpkController@destroy'));</code></pre>
  </div>
  </div>
  </p>
  
  <p>And this is the Controller for delete the data</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>public function destroy()
   {
    $spk= Spk::find(Input::get('id'))-&gt;delete();
          Session::flash('message', 'Successfully deleted the SPK !');
          return Redirect::to('spk_view');
   }</code></pre>
  </div>
  </div>
  </p>
  
  <p>The modal box is working, but when I'm getting the ID to delete, this will be ended with results "method not allowed http exception". Can someone help me please? </p>