title: Undefined function appends() in custom Laravel 5 paginator
body: <p>I am showing data to back end users in a tabular format. I am using Laravel 5 and pagination can be handled with ease.</p>
  
  <p>There is a small requirement when it comes to where to place those links of pages: I want to float them right. Considering that Laravel is using Bootstrap 3 to render the layout, I know I can simply add class "pull-right" into the  element.</p>
  
  <p>So I constructed a custom pagination presenter like so:</p>
  
  <pre><code>namespace App\Http\Presenters;
  
  use Illuminate\Pagination\BootstrapThreePresenter;
  
  class DatatablePaginationPresenter extends BootstrapThreePresenter{
  
      public function render()
      {
          if ($this-&gt;hasPages())
          {
              return sprintf(
              '&lt;ul class="pagination pull-right"&gt;%s %s %s&lt;/ul&gt;',
              $this-&gt;getPreviousButton(),
              $this-&gt;getLinks(),
              $this-&gt;getNextButton()
             );
          }
          return '';
      }
  } 
  </code></pre>
  
  <p>And the code in the template file:</p>
  
  <pre><code>&lt;div class="row"&gt;
      &lt;div class="col-md-4"&gt;Some text&lt;/div&gt;
      &lt;div class="col-md-8"&gt;
      {!!  with(new App\Http\Presenters\DatatablePaginationPresenter($articles))-&gt;render() !!}
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Laravel works without errors until I add some parameters in those links by calling appends(), for example:</p>
  
  <pre><code>{!!  with(new App\Http\Presenters\DatatablePaginationPresenter($articles))-&gt;appends(['sort' =&gt; $column,'order' =&gt; $order,'term' =&gt; $term])-&gt;render() !!}
  </code></pre>
  
  <p>This time I got a FatalException saying Call to undefined method App\Http\Presenters\DatatablePaginationPresenter::appends()</p>
  
  <p>I walked through some source code to find out how appends() works. It is declared in the \Illuminate\Contracts\Pagination\Paginator interface, and any class implements this interface should define it. Given that my Article class extends Eloquent, getting a paginated collection should get a paginator which already implements appends().
  So it is really weird that appends() is not defined.</p>
  
  <p>Here is the code of my repo/service layer returning paginated data to my controller.</p>
  
  <pre><code>$articles =  Article::with('category')
          -&gt;select($columns)
          -&gt;orderBy($column,$order)
          -&gt;paginate($itemPerPage);
  
  return $articles;
  </code></pre>