laravelista / comments

Native comments for your Laravel application.
MIT License
745 stars 144 forks source link

[Feature] Pagination #70

Closed owaismohsin001 closed 4 years ago

owaismohsin001 commented 4 years ago

I am trying to add pagination to this package but can't seem to figure where out where to add ->paginate(8) and I have tried to add it in components.blade.php in two areas First attempt

$grouped_comments = $comments->sortByDesc('created_at')->groupBy('child_id')->paginate(6);

Second question

$comments = $model->comments->paginate(6);

I am using Laravel 5.8. I know I am missing something really simple but I am still a beginner when it comes to Laravel.

mabasic commented 4 years ago

This package does not support pagination at the moment, but it can be implemented in the view by manually creating a paginator. I'm open to a PR, or you could wait while I implement this functionality.

mabasic commented 4 years ago

I've implemented pagination in 3.2.0. See the readme for instructions.

owaismohsin001 commented 4 years ago

I used something else for that project but now I can finally use it. Thank you very much.