Biz Dev B
Biz Dev B

Reputation: 383

How to display Laravel Pagination

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

enter image description here

How can i do that

Upvotes: 2

Views: 898

Answers (1)

Tomas Ramirez Sarduy
Tomas Ramirez Sarduy

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

Related Questions