shamon's avatar

Laravel 5.3 :manual pagination with custom array not displaying links in page

I am trying to implement a manual pagination with custom array in Laravel everything works fine except with the pagination links. Pagination links not displayed in the page

Controller

                 $perPage = 3;
                 $currentPage = Input::get('page',1)-1;
                 $pagedData = array_slice($this->data->arts->toArray(),$currentPage*$perPage,$perPage);
                 $this->data['paged'] = new Paginator($pagedData, count($this->data->arts), $perPage);

View.blade

@forelse($data['paged']->chunk(3) as $array)
   ......
   @endforelse
   <!--displaying links-->
   {{$data['paged']->links()}}

$data['paged']->links() give an empty bootstrap pagination markup

Update

ouput of dd($data['paged'])

Paginator {#233 ▼
  #hasMore: false
  #items: Collection {#235 ▶}
  #perPage: 7
  #currentPage: 3
  #path: "/"
  #query: []
  #fragment: null
  #pageName: "page"
}
0 likes
0 replies

Please or to participate in this conversation.