title: Append to pagination links URL in Laravel
body: <p>How can I append:</p>
  
  <pre><code>#products
  </code></pre>
  
  <p>To the end of the pagination URL used by Laravels pagination links method so I could get the following in the address bar?:</p>
  
  <pre><code>products?page=3#products
  </code></pre>
  
  <p>This is so that my mobile users and people with low resolution desktops don't have to scroll down the page every time they navigate using the pagination links.</p>
  
  <hr>
  
  <p>This is what I have in my config/view:</p>
  
  <pre><code>/*
      |--------------------------------------------------------------------------
      | Pagination View
      |--------------------------------------------------------------------------
      |
      | This view will be used to render the pagination link output, and can
      | be easily customized here to show any view you like. A clean view
      | compatible with Twitter's Bootstrap is given to you by default.
      |
      */
  
      'pagination' =&gt; 'products.ProductPresenter',
  </code></pre>
  
  <p>And I'm getting:</p>
  
  <pre><code>Method Illuminate\View\View::__toString() must not throw an exception
  </code></pre>
  
  <p>My presenter as per Laravel documentation:</p>
  
  <pre><code>class ProductPresenter extends Illuminate\Pagination\Presenter {
  
      public function getActivePageWrapper($text)
      {
          return '&lt;li class="current"&gt;&lt;a href=""&gt;'.$text.'&lt;/a&gt;&lt;/li&gt;';
      }
  
      public function getDisabledTextWrapper($text)
      {
          return '&lt;li class="unavailable"&gt;&lt;a href=""&gt;'.$text.'&lt;/a&gt;&lt;/li&gt;';
      }
  
      public function getPageLinkWrapper($url, $page, $rel = null)
      {
          return '&lt;li&gt;&lt;a href="'.$url.'"&gt;'.$page.'&lt;/a&gt;&lt;/li&gt;';
      }
  
  }
  </code></pre>