Reputation: 383
I am getting Data using Eloquent by the following way and with pageinate
$BlogData = BlogModel::paginate(2);
I am getting 2 coloumn in the target page but i don't know how to display the pagination in the view.
I tried to display
{{ $paginator->getUrl($paginator->getCurrentPage()+1) }}
{{$paginator->links();}}
But it throws error Undefined variable: paginator (View: C:\xampp\htdocs\app\views\Blo
How can i do that
Upvotes: 2
Views: 898
Reputation: 17471
If you are passing the $blogData
to the view, you just need to use {{$blogData->links}}
in the blade template. Is very clear how to use it in the official docs: http://laravel.com/docs/4.2/pagination
Upvotes: 1