I have this view called posts.blade.php
which gets included in home.blade.php
:
@foreach ($posts as $po
I'm not very familiar with pagination in Laravel but judging from the links you listed it doesn't look too hard. This code is untested though...
$('#pagination a').on('click', function(e){
e.preventDefault();
var url = $(this).attr('href');
$.post(url, $('#search').serialize(), function(data){
$('#posts').html(data);
});
});
In case the pagination links are wrong (like the were for the OP) you have to build the url by yourself.
Just take the url you want and add ?page=#number
to it.
// page being the page number stripped from the original link
var url = $('#search').attr('action')+'?page='+page;