title: How can I make the pagination buttons work using belongsto and hasmany relationship?
body: <p>There seems to be no error when clicking the button but it doesn't redirect me to <code>page=2</code>, I tried right clicking it and opening it to another tab and it works just fine. I also tried using it with ajax but the problem is the button, it won't go to page 2.</p>
  <p>Controller</p>
  <pre><code>$decryptedID = Crypt::decrypt($id); //decryps the encrypted id
          $comments = Articles::where('id',$decryptedID)-&gt;where('slug',$slug)-&gt;first()-&gt;with('comments')-&gt;paginate(5,['*'],'comments');
          return view('articles.article',compact(['comments']))-&gt;render();
  </code></pre>
  <p>web.php</p>
  <pre><code>Route::get('/news/article/{id}/{slug}','Admin\ArticlesController@show')
          -&gt;where('slug','[\w\d\-\_]+')
          -&gt;name('articles');
  </code></pre>
  <p>here's an example of the http link:
  <code>/news/article/37/Test-Image-Upload-Summernote</code></p>
  <p>View</p>
  <pre><code>&lt;div class=&quot;row comments&quot;&gt;
              @foreach ($comments as $comment )
                  &lt;div class=&quot;card mt-1 border-0&quot;&gt;
                      &lt;div class=&quot;card-body comment&quot;&gt;
                          &lt;div class=&quot;row&quot;&gt;
                              &lt;div class=&quot;d-inline-block&quot;&gt;
                                  &lt;strong class=&quot;user-name&quot;&gt;{{ $comment-&gt;name}}&lt;/strong&gt;
                                  &lt;span class=&quot;text-muted user-time&quot;&gt;• {{ $comment-&gt;created_at-&gt;diffForHumans() }}&lt;/span&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class=&quot;user-comment&quot;&gt;{{ $comment-&gt;comment }}&lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              @endforeach
              &lt;div class=&quot;row mt-3&quot;&gt;
                  {!!  $comments-&gt;links() !!}
              &lt;/div&gt;
          &lt;/div&gt;
  </code></pre>