$orders = DB::table('orders')->paginate($per_page, array('id', 'name', 'created_at'));
<?php foreach ($orders->results as $order): ?> <?php echo $order->id; ?> <?php endforeach; ?>
<?php echo $orders->links(); ?>
Previous 1 2 … 24 25 26 27 28 29 30 … 78 79 Next
<?php echo $orders->appends(array('sort' => 'votes'))->links();
http://example.com/something?page=2&sort=votes
$orders = Paginator::make($orders, $total, $per_page);
<div class="pagination"> <ul> <li class="previous_page"><a href="foo">Previous</a></li> <li><a href="foo">1</a></li> <li><a href="foo">2</a></li> <li class="dots disabled"><a href="#">…</a></li> <li><a href="foo">11</a></li> <li><a href="foo">12</a></li> <li class="active"><a href="#">13</li> <li><a href="foo">14</a></li> <li><a href="foo">15</a></li> <li class="dots disabled"><a href="#">…</a></li> <li><a href="foo">25</a></li> <li><a href="foo">26</a></li> <li class="next_page"><a href="foo">Next</a></li> </ul> </div>
<li class="disabled previous_page"><a href="#">Previous</a></li>