public static function sortableTh($fieldName, $route, $label = null)
{
$output = "<th>";
$sortType = "asc";
if (Request::input("sort") == $fieldName and Request::input("sortType") == "asc") {
$sortType = "desc";
}
$params = array_merge(Request::query(), ['sort' => $fieldName, 'sortType' => $sortType]);
$href = route($route, $params);
$output .= "<a href='{$href}'>";
$label = $label ?: ucwords(str_replace("_", " ", $fieldName));
$output .= $label;
if (Request::input("sort") == $fieldName) {
$output .= " <i class='fa fa-sort-alpha-" . Request::input("sortType") . "'></i>";
}
$output .= "</a>";
$output .= "</th>";
return $output;
}