With a query that has a select and a join, sorting by a column in the joined table overwrites the original query select, in the formJoin function:
private function formJoin($query, $parentTable, $relatedTable, $parentPrimaryKey, $relatedPrimaryKey)
{
$joinType = config("columnsortable.join_type", "leftJoin");
return $query->select($parentTable.".*")->{$joinType}($relatedTable, $parentPrimaryKey, "=", $relatedPrimaryKey);
}
I think the fix is to change the ->select() to ->addSelect()?
With a query that has a select and a join, sorting by a column in the joined table overwrites the original query select, in the formJoin function:
I think the fix is to change the
->select()to->addSelect()?