Pagination::make() method doesn\'t exist in Pagination class anymore in Laravel 5.
Is there a workaround to make manual pagination work in Laravel 5?
Try below code for manual pagination
40 && $item['id']<50){
array_push($filter_products, $item);
}
}
$count = count($filter_products); // total product for pagination
$page = $request->page; // current page for pagination
// manually slice array of product to display on page
$perPage = 5;
$offset = ($page-1) * $perPage;
$products = array_slice($filter_products, $offset, $perPage);
// your pagination
$products = new Paginator($products, $count, $perPage, $page, ['path' => $request->url(),'query' => $request->query(),]);
// use {{ $products->appends($_GET)->links() }} to dispaly your pagination
return view('index',['products' => $products]);
}
}