Questions & Answers

How can we make the page not refreshing on pagination in laravel?

On clicking page 2 or 3 ..., the input data on page 1 disappears as the page refreshes.

I expect page not refresh.

Answers(1) :

In Laravel, you can use JavaScript and the HTML5 History API to make pagination without refreshing the page. One way to do this is by using a library such as Vue.js to handle the pagination and updating the content on the page without refreshing. You can also use jQuery to make an AJAX request to the server to load the next page of data and then update the content on the page with the new data.

Another way is you can use will_paginate gem and set javascript:false, this will make the pagination to work without page refresh. {{ $users->appends(request()->except('page'))->links('vendor.pagination.default', ['javascript:false']) }} It's recommended that you consult the Laravel documentation on pagination and the HTML5 History API for more information and examples of how to implement this in your specific use case.