Laravel Paginator object does not have render method

Posted 1 year ago by jeloqim

I do the following:

    $array = new LengthAwarePaginator(array_slice($array, $offset, $perPage, true), count($array),$perPage, $page, ['path' => $request->url(), 'query' => $request->query()]);

and i get the proper html output of the render method.

Then I try:

    $array =  new Paginator(array_slice($array, $offset, $perPage, true), $perPage, $page, ['path' => $request->url(), 'query' => $request->query()]);

and the output is "".

When I (dd($array)); I get :

    Paginator {#310 ▼
      #hasMore: false
      #items: Collection {#315 ▶}
      #perPage: 10
      #currentPage: 1
      #path: "https://localhost/search/3"
      #query: array:1 [▶]
      #fragment: null
      #pageName: "page"

Anyone know why my Paginator doesn't have a render method? I am using 5.2.45

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up


Reply to

Use Markdown with GitHub-flavored code blocks.