Are you sure you want to return the view and not just the data? Plus, youre calling render() on the response, not the paginator. I dont think thats going to work. Not sure though...
Are you actually making the pagination anywhere?
Can anyone give me an example of how i can get ajax pagination to work with Laravel 5. Ive seen some old tutorials using L4 but it does not seem to work with the new l5 pagination.
if ($request->ajax()) {
return response()->view('dashboard.partials.products')->with('products', $products))
->render();
}
function getPosts(page) {
$.ajax({
url : '?page=' + page,
dataType: 'json',
}).done(function (data) {
console.log(data);
$('#products').html(data);
location.hash = page;
}).fail(function () {
alert('Posts could not be loaded.');
});
}
If fails the ajax request.
Please or to participate in this conversation.