title: Laravel 5 Pagination sort by from user input
body: <p>i want an option for the user to sort the pagination from either in ascending or descending order. i tried the code below but i dont know how to insert the selected value.</p>
  
  <p>index.blade.php  </p>
  
  <pre><code>   &lt;select name="orderby" id="orderby"&gt;
                  &lt;option value="asc"&gt;Ascending&lt;/option&gt;
                  &lt;option value="desc"&gt;Descending&lt;/option&gt;
              &lt;/select&gt;
  
      {!! $finding_tbl-&gt;appends(['sort' =&gt; 'here'])-&gt;render() !!}
  </code></pre>
  
  <p>here is my index in PagesController</p>
  
  <pre><code> public function index()
      {
          $sort =$_GET['sort'];
          $finding_tbl = findings::orderBy('id', $sort)-&gt;paginate(5);
          $finding_tbl-&gt;setPath('home');
          return view('pages.index',compact('finding_tbl','sort') );
      }
  </code></pre>