title: Laravel 5.4 Displaying editing options in modal from view?
body: <p>I have succesfully created an application within Laravel which allows users to edit posts for a item. The current method is by redirecting user to different page where they are able to make changes. However to increase the user expirence I was planning to add 'modal' within the page. Meaning that editing posts will happen within the same page. This method for me partly works. In a aspect that the last or the latest post is only editable post. If I click on any of the posts it makes me only make changes to the latest post. Any help, suggestions or examples are trully appreciated.</p>
  
  <p>Below I have attached my show.blade.php which shows the item infromation and posts.</p>
  
  <pre><code>&lt;ul class="list-group"&gt;
  
  
  @foreach ($car-&gt;reviews as $review)
  &lt;li class="list-group-item"&gt;
  
      &lt;strong&gt;
          Created by: {{ $review-&gt;user-&gt;name}} {{ $review-&gt;created_at-&gt;diffForHumans() }}:
          &lt;br&gt;
          Updated by: {{ $review-&gt;user-&gt;name}} {{ $review-&gt;updated_at-&gt;diffForHumans() }}:
  
      &lt;/strong&gt;
  
  
    &lt;a href="/reviews/{{ $review-&gt;id }}/edit" data-toggle="modal" data-target="#myModal1" &gt;{{ $review-&gt;reviewbody }}&lt;/a&gt;
  
  
    &lt;a style="float:right;" href="/reviews/{{$review-&gt;id}}/delete"&gt;Delete&lt;/a&gt;
  </code></pre>
  
  <p></li></p>
  
  <pre><code> @endforeach
  </code></pre>
  
  <p></p>
  
  <p>The Modal</p>
  
  <pre><code>&lt;div class="container"&gt;
        &lt;!-- Trigger the modal with a button --&gt;
        &lt;button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal1"&gt;TEST&lt;/button&gt;
  
        &lt;!-- Modal --&gt;
        &lt;div class="modal fade" id="myModal1" role="dialog"&gt;
          &lt;div class="modal-dialog"&gt;
  
            &lt;!-- Modal content--&gt;
            &lt;div class="modal-content"&gt;
              &lt;div class="modal-header"&gt;
                &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
  
              &lt;/div&gt;
              &lt;div class="modal-body"&gt;
                  &lt;div class="review-edit"&gt;
                      &lt;div class="review-edit-block"&gt;
                          &lt;a href="/reviews/{{ $review-&gt;id }}/edit"&gt;{{ $review-&gt;reviewbody }}&lt;/a&gt;
  
                          &lt;form action="/reviews/{{$review-&gt;id}}" method="POST"&gt;
                            {{ csrf_field() }}
                            {{ method_field('patch') }}
  
                            &lt;div class="form-group"&gt;
                              &lt;textarea style="position:relative;left:10%;width:375px;"name="reviewbody" class="form-control"&gt;{{ $review-&gt;reviewbody }}&lt;/textarea&gt;
                            &lt;/div&gt;
                            &lt;div&gt;
                              &lt;button type="submit" class="btn btn-primary"&gt;Update Review&lt;/button&gt;
  
  
  
                          &lt;/form&gt;
                      &lt;/div&gt;
  
  
                  &lt;/div&gt;
                      &lt;/div&gt;
  
              &lt;/div&gt;
              &lt;div class="modal-footer"&gt;
                &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
              &lt;/div&gt;
            &lt;/div&gt;
  
          &lt;/div&gt;
        &lt;/div&gt;
  </code></pre>