I would like to perform a sort by ascending or descending together with pagination
return \App\User:: paginate($request->per_page);
how do i add the sort by so something like this
return \App\User:: paginate($request->per_page)-sortBy(
$request->sort_field, $request->sort_order
);
bur the above fails where
$request->sort_order //asc or desc
the above returns an error of
"asort() expects parameter 2 to be integer, string given"