title: Passing data to a bootstrap modal from Laravel
body: <p>Wonder if someone can help me with this one.  I am a complete newbie with JS and JQuery.</p>
  
  <p>I want to avoid accidents with deleting posts in my blog, so I want to have it so that when I hit delete it will pop up a modal to confirm I do want to delete the post and then do it or not.</p>
  
  <p>I have added the following code.</p>
  
  <pre><code> &lt;!-- Button trigger modal to delete post --&gt;
  &lt;button type="button" class="btn btn-default btn-xs" data-toggle="modal" data-target="#deletePost"&gt;
    Delete
  &lt;/button&gt;
  
  &lt;!-- Modal --&gt;
  &lt;div class="modal fade" id="deletePost" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"&gt;
    &lt;div class="modal-dialog" role="document"&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" id="myModalLabel"&gt;Delete Blog Post&lt;/h4&gt;
        &lt;/div&gt;
        &lt;div class="modal-body"&gt;
          &lt;p&gt;You are about to delete a blog post, are you sure all that effort is to be sent to the unrecoverable trash can?&lt;/p&gt;
        &lt;/div&gt;
        &lt;div class="modal-footer"&gt;
          &lt;button type="button" class="btn btn-default pull-left" data-dismiss="modal"&gt;OMG, NO!!!&lt;/button&gt;
          &lt;form action="/blog/{{ $post-&gt;id }}" method="POST"&gt;
              {{ csrf_field() }}
              {{ method_field('DELETE') }}
              &lt;button type="submit" class="pull-right btn btn-danger"&gt;Delete it!&lt;/button&gt;
          &lt;/form&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Now all that works fine, all I now want to do is that when I click the "delete it!" button it will do just that.</p>
  
  <p>It all works apart from deleting the right post, I want to pass </p>
  
  <pre><code>{{ $post-&gt;id }}
  </code></pre>
  
  <p>to the modal so that it will send the post id to the controller.  </p>
  
  <p>My question is how I pass the id above to the modal?  I have read a lot of examples and they are all so different so thought it better to get some views.</p>
  
  <p>Thanks!</p>