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.
index.blade.php
<select name="orderby" id="orderby">
<option value="asc">Ascending</option>
<option value="desc">Descending</option>
</select>
{!! $finding_tbl->appends(['sort' => 'here'])->render() !!}
here is my index in PagesController
public function index()
{
$sort =$_GET['sort'];
$finding_tbl = findings::orderBy('id', $sort)->paginate(5);
$finding_tbl->setPath('home');
return view('pages.index',compact('finding_tbl','sort') );
}