How to use pagination in laravel 5?
In Laravel 5 there is no method "links" you can try this
{!! $pages->render() !!}
Pagination Laravel 5.6.26, for the pagination the controller are :
Controller code (https://laravel.com/docs/5.6/pagination#basic-usage)
posts = Post::orderBy('created_at','desc')->paginate(10);
return view('posts.index')->with('posts', $posts);
Front end into blade (view) (https://laravel.com/docs/5.6/pagination#displaying-pagination-results)
{{ $users->links() }}
In other frameworks, pagination can be very painful. Laravel 5 makes it a breeze. For using it, first you have to make a change in your controller code where you calling data from the database:
public function index()
{
$users = DB::table('books')->simplePaginate(5);
//using pagination method
return view('index', ['users' => $users]);
}
...after that you can use this code:
<?php echo $users->render(); ?>
That will make you use simple Laravel 5 beauty.