laravelista / comments

Native comments for your Laravel application.
MIT License
744 stars 142 forks source link

Problem with pagination #108

Closed Goryounov closed 3 years ago

Goryounov commented 4 years ago

Hello! Thanks for awesome plugin. Unfortunately, I have a problem when I am using pagination. My posts URL are: https://mysite.com/article/article-name. With pagination links I have such URLs: https://mysite.com/article/article/article-name?page=1. It doesn`t work and returns 404 error. What should I do to solve this? Thanks.

mabasic commented 4 years ago

Thank you. It should generate the correct URL.

See resources/views/components/comments.blade.php. Look for withPath method. This method adds request()->path to the URLs.

Try seeing what that methods returns for you and try changing it. View the readme on how to publish views for customization.

Let me know if you fix it. Also, posting laravel version would be nice 😊.

Goryounov commented 4 years ago

I changed request()->path to request()->url and it works. I use Laravel 6.18.25

mabasic commented 4 years ago

I changed request()->path to request()->url and it works. I use Laravel 6.18.25

Need to test this to confirm if this is a bug.

ScuffedNewt commented 4 years ago

@mabasic hi! not sure if this helps, but i have also experienced this 'bug' on laravel 5.8 . Changing it to request()->url also fixed it for me. Hope this helps!