Jump to content

Vue.js, Laravel commenting system pagination


Recommended Posts

I am building blog commenting system, using laravel 5.8 and vue.js. I want to add paginate function to comments as per instructions https://adevait.com/laravel/laravel-overwriting-default-pagination-system.

Now I can display five comments, and after I click load more,

I want to show next five comments.

I have no idea how to accomplish. I am glad if someone helps me out.


Cancel Comment

{{ comment.user.name }}
{{ comment.body }}


public function index(Post $post)
return $post->comments()->with(‘user’)->paginate(5);


public function show(Post $post)
$recommended_posts = Post::latest()

// load the post comments here
$posts['particular_post'] = $post;
$posts['recommended_posts'] = $recommended_posts;

return view('posts.show',compact('posts'));


Route::get(‘results/{post}’, ‘ResultsController@show’)->name(‘posts.show’);
Route::get(‘results/{post}/comments’, ‘CommentsController@index’);


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...