title: laravel pagination and sort table
body: <p>I'm using sort function and pagination but the problem when I use sort for any column works fine but when I click to the next page using pagination the sort change and have to click on the column again for sorting.
  so how to keep sorting while using pagination?</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;tr&gt;
      &lt;th&gt;
          &lt;div class="checkbox checkbox-replace"&gt;
              &lt;input type="checkbox" id="chk-3"&gt;
  
          &lt;/div&gt;
      &lt;/th&gt;
  
      &lt;th&gt;@sortablelink('details','Details')&lt;/th&gt;
      &lt;th&gt;@sortablelink('postingdate','Date')&lt;/th&gt;
      &lt;th&gt;@sortablelink('description','Description')&lt;/th&gt;
      &lt;th&gt;@sortablelink('amount','Amount')&lt;/th&gt;
      &lt;th&gt;@sortablelink('type','Type')&lt;/th&gt;
      &lt;th&gt;@sortablelink('slip','Slip#')&lt;/th&gt;
      &lt;th&gt;@sortablelink('vendor_id','Vendor')&lt;/th&gt;
      &lt;th&gt;@sortablelink('category_id','Category')&lt;/th&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <pre class="lang-php prettyprint-override"><code>public function index()
  {
      $checks = Checks::orderBy('id', 'asc')-&gt;get();
  
      $checks= Checks::sortable()-&gt;paginate(5);
  
      return view('home',compact('checks'));
  }
  </code></pre>