title: show comment data on post laravel
body: <p>So yesterday I success to count comment from post, now I want to show comment in admin dashboard, so here is my code in controller</p>
  
  <pre><code>public function getComment()
  {
      $user = Auth::user();
      $posts = $user-&gt;posts();
  
      foreach ($posts as $key =&gt; $value) {
          $posts[$key]-&gt;post_comments = PostComment::where('post_id', $value-&gt;id)-&gt;get(); 
      }
      return $posts;
  }
  </code></pre>
  
  <p>and here is my web.php route code to get this comment</p>
  
  <pre><code>Route::get('/comment/post/{id}', 'DashboardController@getComment');
  </code></pre>
  
  <p>But it retrieve all comment even in different post, I only want to get comment from same post that I want. The weird one is when I click the button it retrieve random id not the id from the post, it look like this</p>
  
  <blockquote>
    <p><a href="http://127.0.0.1:8000/comment/post/%7Bid%7D" rel="nofollow noreferrer">http://127.0.0.1:8000/comment/post/%7Bid%7D</a></p>
  </blockquote>
  
  <p>hope you guys can help me thanks</p>